From: svermeul@suntzu.psg.datap.ca (Stephen Vermeulen)
Message-Id: <199603151850.LAA02047@alien.psg.datap.ca>
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Subject: Re: Customizing custom classes, perhaps for the FAQ
X-Sun-Charset: US-ASCII
Resent-Message-Id: <"TJDle.0.J_5.GDOJn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/675
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 1281
X-Lines: 37
Status: RO

> Stefan,
>
> Do you (or anyone else) have any example code that illustrates how one goes about
> writing a MUI custom class (in particular the New function of the class) where the
> exact contents of the class are in some way customized at construction time.  For
> example you might have a fancy group containing a list, where you want the list
> to default to handling strings (the built in string construction/destruction hooks)
> but sometimes you want to use the same class to display a list which needs custom
> construct/destruct/display behaviour.
>
> Regards, Stephen

I managed to find enough of an example of almost this in the "class2.c" and psi.c example
code to piece together what to do.  Looks like what you do is at the start of
your class's new() you can do something like:

SAVEDS ULONG myclass_new(struct IClass *cl,Object *obj,Msg msg)
{

        struct TagItem *tag;

        if (tag = FindTagItem(MUIA_myclass_myattr,msg->ops_AttrList))
        {
          /* obtain your data with...
             ULONG mydata;
             mydata = tag->ti_Data;
           */
        }

        /* the "regular" DoSuperNew() follows, into this you can now
           include any data from your own tags that you picked up from
           the above code...
         */
}

Regards, Stephen



From: "Stefan Stuntz" 
Date:   Thu, 29 Feb 1996 16:36:44 +0100
X-Mailer: IntuiNews 1.3b Beta 5 (3.1.96)
Subject: Re: PSI-screens
Message-Id: <81319716@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"-FpbX3.0.UT.wqTDn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/453
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 641
X-Lines: 16
Status: RO

Sven Steiniger wrote

> My application have to be informed when the application-screen (PSI-screen)
> is opened/closed. Has anybody an idea? Stefan?
> Imagine, you change the preference with mui-prefs. MUI then close all the
> windows and then reopens it. But beetwen that PSI noticed that all windows
> on the screen are closed and close the screen. So everytime the prefs are
> changed, I have to get a new screenpointer to set the screenaspect etc.
> Currently I trigger MUI_Show in one of my customclasses but this is also
> invoked when the windowsize has changed.

Screen information is available in MUIM_Setup.

--
Greetings, Stefan


From: nsprodjt@BIX.com
Subject: Subclass List and CDDA Panel Problem
To: robv@si.hhs.nl

Subject: Creatting custom classes & attribute notification
==========================================================
>Is there any way to create custom classes which have no interface?
>(that is, are not a subclass of the Area class.)

Yeah, sure there is, write a subclass of Notify class. The only
standard methods you need are New/Dispose and Set/Get.

I started writing apps the "new" way for MUI 2 and everything in my
application is a custom class including the stuff that has no
visible interface.

From: "Stefan Stuntz" 
Date:   Thu, 07 Dec 1995 15:48:47 +0100
X-Mailer: IntuiNews 1.3b Beta 3 (5.11.95)
Subject: Re: Creatting custom classes & attribute notification
Message-Id: <64540039@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"Gbu8z3.0.Wi.-_7pm"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/46
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 281
X-Lines: 11
Status: RO

robv wrote in article <9512061459.AA21506@staring.si.hhs.nl>:

> Is there any way to create custom classes which have no interface?
> (that is, are not a subclass of the Area class.)

You can create subclasses of anything you want, starting from
root class.

--
Greetings, Stefan


From: "Stefan Stuntz" 
Date:   Thu, 07 Dec 1995 15:48:47 +0100
X-Mailer: IntuiNews 1.3b Beta 3 (5.11.95)
Subject: Re: Clipping in SubClasses
Message-Id: <64540040@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"YrAbG3.0.Fi.z_7pm"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/45
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 889
X-Lines: 26
Status: RO

Georg Kraemer wrote

> 1.) What is the correct way of clipping inside a SubClass ? Currently
> I simply set Clipping to the inner of the gadget, but this may be
> conflict with Clipping of virtual Groups for example. Of cause
> clipping is only done during the DRAW Method.

Use MUI_AddClipping()/MUI_RemoveClipping() from muimaster.library, never
use InstallClipRegion() in MUI-Windows.

> 2.) Is there a Message telling me (the Subclass) if the size of the
> gadget changes ? I need to rescale some Vektors if so. Currently I
> compare the dimensions of the gadget at the beginning of DRAW whether
> they changed or not.

MUIM_Show and MUIM_Hide.

> 3.) Whats the way to support Drag'n Drop in a SubClass ? (How can I
> build the Image for Drag with a self drawn object if it differs from
> original [Multiselect]?)

Currently, you cannot customize the D&D image.

--
Greetings, Stefan

From: "Stefan Stuntz" 
Date:   Tue, 30 Jan 1996 19:40:36 +0100
X-Mailer: IntuiNews 1.3b Beta 5 (3.1.96)
Subject: Re: Label with Text.mui
Message-Id: <81318667@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"So_Ci1.0.8D7.D5f3n"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/208
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 8476
X-Lines: 397
Status: RO

Thomas Wilhelmi wrote in article <19960130.15EFC28.10EB7@twi.rhein-main.de>:

> > Why you can't use MakeObject objects in CustomClasses?
>
> Of course I can call MakeObject in a custom-class. But I
> need a little bit of own code for disposing the Objects.
> And that's the reason why I need a custom-class even
> for labels.

Using MUI_MakeObject() is the better solution. However, if you
cannot do that because you want to make your labels & buttons
etc. with your own subclasses, heres the source of what
MUI_MakeObject() currently does.

static LONG GetControlChar(char *label)
{
        if (label)
        {
                char *c;
                if (c = strchr(label,'_'))
                        return(ToLower(*(c+1)));
        }
        return(0);
}


Object * __asm __saveds make_label(_a0 ULONG *params)
{
        #define label ((char *)params[0])
        #define flags ((ULONG )params[1])
        Object *o;

        o = TextObject,
                MUIA_Text_Contents    , label,
                MUIA_Weight           , 0,
                MUIA_InnerLeft        , 0,
                MUIA_InnerRight       , 0,
                MUIA_FramePhantomHoriz, TRUE,
                flags & 0xff                     ? TAG_IGNORE       : MUIA_Text_HiIndex , '_',
                flags & 0xff                     ? MUIA_Text_HiChar : TAG_IGNORE        , flags & 0xff,
                flags & MUIO_Label_SingleFrame   ? MUIA_Frame       : TAG_IGNORE        , MUIV_Frame_Button,
                flags & MUIO_Label_DoubleFrame   ? MUIA_Frame       : TAG_IGNORE        , MUIV_Frame_String,
                flags & MUIO_Label_LeftAligned   ? TAG_IGNORE       : MUIA_Text_PreParse, "\33r",
                flags & MUIO_Label_Centered      ? MUIA_Text_PreParse : TAG_IGNORE      , "\33c",
                flags & MUIO_Label_FreeVert      ? MUIA_Text_SetVMax  : TAG_IGNORE      , FALSE,
                End;

        return(o);
}


Object * __asm __saveds make_button(_a0 ULONG *params)
{
        #define label ((char *)params[0])
        Object *o;

        o = TextObject,
                ButtonFrame,
                MUIA_Text_Contents, label,
                MUIA_Text_PreParse, "\33c",
                MUIA_Text_HiIndex , '_',
                MUIA_ControlChar  , GetControlChar(label),
                MUIA_InputMode    , MUIV_InputMode_RelVerify,
                MUIA_Background   , MUII_ButtonBack,
                MUIA_Font         , MUIV_Font_Button,
                End;

        return(o);
}


Object * __asm __saveds make_checkmark(_a0 ULONG *params)
{
        #define label ((char *)params[0])
        Object *o;

        o = ImageObject,
                ImageButtonFrame,
                MUIA_InputMode     , MUIV_InputMode_Toggle,
                MUIA_Image_Spec    , MUII_CheckMark,
                MUIA_Image_FreeVert, TRUE,
                MUIA_Background    , MUII_ButtonBack,
                MUIA_ShowSelState  , FALSE,
                MUIA_ControlChar   , GetControlChar(label),
                End;

        return(o);
}


Object * __asm __saveds make_cycle(_a0 ULONG *params)
{
        #define label   ((char *)params[0])
        #define entries ((char **)params[1])
        Object *o;

        o = CycleObject,
                MUIA_Cycle_Entries, entries,
                MUIA_ControlChar  , GetControlChar(label),
                MUIA_Font         , MUIV_Font_Button,
                End;

        return(o);
}


Object * __asm __saveds make_radio(_a0 ULONG *params)
{
        #define label   ((char *)params[0])
        #define entries ((char **)params[1])
        Object *o;

        o = RadioObject,
                label ? MUIA_Frame      : TAG_IGNORE, MUIV_Frame_Group,
                label ? MUIA_FrameTitle : TAG_IGNORE, label,
                MUIA_Radio_Entries, entries,
                MUIA_ControlChar  , GetControlChar(label),
                End;


        return(o);
}


Object * __asm __saveds make_slider(_a0 ULONG *params)
{
        #define label ((char *)params[0])
        #define min   ((LONG  )params[1])
        #define max   ((LONG  )params[2])
        Object *o;

        o = SliderObject,
                MUIA_Slider_Min , min,
                MUIA_Slider_Max , max,
                MUIA_ControlChar, GetControlChar(label),
                End;

        return(o);
}


Object * __asm __saveds make_string(_a0 ULONG *params)
{
        #define label ((char *)params[0])
        #define maxlen params[1]
        Object *o;

        o = StringObject,
                StringFrame,
                MUIA_ControlChar  , GetControlChar(label),
                MUIA_String_MaxLen, maxlen,
                End;

        return(o);
}


Object * __asm __saveds make_popbutton(_a0 ULONG *params)
{
        #define img ((STRPTR)params[0])
        Object *o;

        o = ImageObject,
                ImageButtonFrame,
                MUIA_Image_Spec          , img,
                MUIA_Image_FontMatchWidth, TRUE,
                MUIA_Image_FreeVert      , TRUE,
                MUIA_InputMode           , MUIV_InputMode_RelVerify,
                MUIA_Background          , MUII_BACKGROUND,
                End;

        return(o);
}


Object * __asm __saveds make_hspace(_a0 ULONG *params)
{
        #define size ((LONG)params[0])
        Object *o;

        if (size<0)
        {
                o = RectangleObject,
                        MUIA_HorizWeight, -size,
                        MUIA_VertWeight , 0,
                        End;
        }
        else
        {
                o = RectangleObject,
                        size ? MUIA_FixWidth : TAG_IGNORE, size,
                        MUIA_VertWeight, 0,
                        End;
        }

        return(o);
}


Object * __asm __saveds make_vspace(_a0 ULONG *params)
{
        #define size ((LONG)params[0])
        Object *o;

        if (size<0)
        {
                o = RectangleObject,
                        MUIA_HorizWeight, 0,
                        MUIA_VertWeight , -size,
                        End;
        }
        else
        {
                o = RectangleObject,
                        size ? MUIA_FixHeight : TAG_IGNORE, size,
                        MUIA_HorizWeight, 0,
                        End;
        }

        return(o);
}


Object * __asm __saveds make_hbar(_a0 ULONG *params)
{
        #define size params[0]
        Object *o;

        o = RectangleObject,
                MUIA_Rectangle_HBar, TRUE,
                MUIA_FixHeight     , size,
                End;

        return(o);
}


Object * __asm __saveds make_vbar(_a0 ULONG *params)
{
        #define size params[0]
        Object *o;

        o = RectangleObject,
                MUIA_Rectangle_VBar, TRUE,
                MUIA_FixWidth      , size,
                End;

        return(o);
}


Object * __asm __saveds make_menuitem(_a0 ULONG *params)
{
        #define label    ((char *)params[0])
        #define shortcut ((char *)params[1])
        #define flags    ((ULONG )params[2])
        #define data     ((ULONG )params[3])

        Object *o;

        o = MenuitemObject,
                MUIA_Menuitem_Title   , label,
                MUIA_Menuitem_Shortcut, shortcut,
                MUIA_Menuitem_Enabled , (flags & NM_ITEMDISABLED) ? FALSE : TRUE ,
                MUIA_Menuitem_Checkit , (flags & CHECKIT        ) ? TRUE  : FALSE,
                MUIA_Menuitem_Checked , (flags & CHECKED        ) ? TRUE  : FALSE,
                MUIA_Menuitem_Toggle  , (flags & MENUTOGGLE     ) ? TRUE  : FALSE,
                MUIA_UserData         , data,
                End;

        return(o);
}


Object * __asm __saveds make_menustripnm(_a0 ULONG *params)
{
        #define newmenu ((struct NewMenu *)params[0])
        #define flags  params[1]
        struct NewMenu *nm;
        Object *strip=NULL,*menu=NULL,*item=NULL,*o;

        for (nm=newmenu;nm->nm_Type!=NM_END;nm++)
                if (nm->nm_Type==NM_TITLE)
                        break;

        if (nm->nm_Type==NM_TITLE)
        {
                strip = MenustripObject,End;
                if (!strip) return(NULL);
        }

        for (nm=newmenu;nm->nm_Type!=NM_END;nm++)
        {
                if (nm->nm_Type==NM_TITLE)
                {
                        o = MenuObject,
                                MUIA_Menu_Title  , nm->nm_Label,
                                MUIA_UserData    , nm->nm_UserData,
                                MUIA_Menu_Enabled, (nm->nm_Flags & NM_MENUDISABLED) ? FALSE : TRUE,
                                End;

                        if (!o) break;
                        if (strip) DoMethod(strip,OM_ADDMEMBER,o);
                        menu = o;
                }
                else
                {
                        o = MenuitemObject,
                                MUIA_Menuitem_Title   , nm->nm_Label,
                                MUIA_Menuitem_Shortcut, (nm->nm_CommKey==NULL && (flags & MUIO_MenustripNM_CommandKeyCheck)) ? (STRPTR)MUIV_Menuitem_Shortcut_Check : nm->nm_CommKey,
                                MUIA_Menuitem_Exclude , nm->nm_MutualExclude,
                                MUIA_UserData         , nm->nm_UserData,
                                MUIA_Menuitem_Enabled , (nm->nm_Flags & NM_ITEMDISABLED) ? FALSE : TRUE ,
                                MUIA_Menuitem_Checkit , (nm->nm_Flags & CHECKIT        ) ? TRUE  : FALSE,
                                MUIA_Menuitem_Checked , (nm->nm_Flags & CHECKED        ) ? TRUE  : FALSE,
                                MUIA_Menuitem_Toggle  , (nm->nm_Flags & MENUTOGGLE     ) ? TRUE  : FALSE,
                                End;

                        if (!o) break;

                        if (nm->nm_Type==NM_ITEM)
                        {
                                if (menu) DoMethod(menu,OM_ADDMEMBER,o);
                                item = o;
                        }
                        else if (nm->nm_Type==NM_SUB)
                        {
                                DoMethod(item,OM_ADDMEMBER,o);
                        }
                }
        }

        if (nm->nm_Type!=NM_END)
        {
                if (strip)
                {
                        MUI_DisposeObject(strip);
                        return(NULL);
                }
                else if (menu)
                {
                        MUI_DisposeObject(menu);
                        return(NULL);
                }
                else if (item)
                {
                        MUI_DisposeObject(item);
                        return(NULL);
                }
        }

        return(strip ? strip : item);
}


Object * __asm __saveds make_bartitle(_a0 ULONG *params)
{
        #define label ((char *)params[0])
        Object *o;

/*
        o = HGroup,
                Child, MUI_MakeObject(MUIO_HBar,1),
                Child, TextObject, MUIA_Text_Contents, label, MUIA_Weight, 0, End,
                Child, MUI_MakeObject(MUIO_HBar,1),
                End;
*/

        o = RectangleObject, MUIA_Rectangle_HBar, TRUE, MUIA_Rectangle_BarTitle, label, MUIA_VertWeight, 0, End;

        return(o);
}


Object * __asm __saveds make_numericbutton(_a0 ULONG *params)
{
        #define label ((char *)params[0])
        #define min   (params[1])
        #define max   (params[2])
        #define format ((char *)params[3])
        Object *o;

        o = NumericbuttonObject,
                ButtonFrame,
                MUIA_Background    , MUII_ButtonBack,
                MUIA_ControlChar   , GetControlChar(label),
                MUIA_Numeric_Min   , min,
                MUIA_Numeric_Max   , max,
                MUIA_Numeric_Format, format,
                End;

        return(o);
}

--
Greetings, Stefan

From: m.jantz@public.ndh.com (Marcel Jantz)
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Subject: Re: Some questions...
In-Reply-To: <65641250%agos001@pn.itnet.it>
Message-Id: <2166.6614T948T2861@public.ndh.com>
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: THOR 2.21 (Amiga;TCP/IP) *UNREGISTERED*
Lines: 54
Resent-Message-Id: <"G00zH2.0.QD2.s7B7n"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/260
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 55
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 2167


Stefano Agostinelli wrote,
>Hi,
>some questions for mui experts:
>1)What is the purpose of "what" argument in MCC_Query (or of "which"
>  in the old MCC_GetClass)? The code I've seen (UserData.c as found in
>  mui32dev) requires that it is 0, so are there other uses for it?
>2)Is it possible to make a library containing two (or more) mui public
>  classes?
>3)Is the use of OCLASS boopsi macro always allowed? And if yes,why
>  not discard INST_DATA(cl,obj) and use instead something like
>  NEWINST_DATA(obj)=INST_DATA(OCLASS(obj),obj)?

Because it maybe of some interest to use a object as member of the superclass or
the superclass' superclass etc. E.g. you may wish to use a slider as an area or
an appla as a fruit. So for some special cases it may be useful to declare the
function INST_DATA as you suggested, but it's more objectoriented correctly to
use the supplied macro.

>4)Why doesn't GetAttr return directly the requested attribute? I mean
> you have to pass it a storage pointer,why not use the return value
> for that?

Look at the psi.c example. There's a function called xget, which does exactly
what you want. I think, the reason why GetAttr works the way it does is because
you can easily give a pointer to a struct or something likely and get it filled
with the internal values/Attributes of the object. There's no way (at least
in C) to do this. In C++ you could of course use references for that.


From: Kristofer Maad 
X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.5 sun4m)
Mime-Version: 1.0
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Subject: Idea: "Figure" class for 2-D drawings?
X-Url: http://sunsite.informatik.rwth-aachen.de/Listen/mui/date.html#start
Content-Transfer-Encoding: 7bit
Resent-Message-Id: <"-ktnX2.0.5T4.LLs8n"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/322
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 44
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 2001

Hi all!

I have been busy the past weeks developing a cusom class for
editing/showing B-Spline curves. Now, I was thinking that perhaps one
could extend this and make a class suitable for general 2-dimensional
drawings. It could have support for drawing lines, curves, text, etc.
and remember everything drawn so that it could redraw itself
automatically without the application needing to remember its contents.

Then I got another idea. Why not make a small class hierarchy of figure
elements? For example, if you want a diagram, the axes will get
cluttered if the window is made smaller, so the different figure
elements would better know how to redraw themselves properly. If I could
make this object-oriented, one could easily add figure elements of one's
own, just like adding classes to MUI. The main difference is that figure
elements will share the space, so that you can have a figure with both
text, curves and text in it, even overlapping. Thus, the display
environment/clipping/etc. will be completely taken care of by the (new)
Figure MUI class, so what's left is for the elements to do some
reasonable rendering based on the figure object's size, colour
preferences, etc.

Perhaps could the figure elements add "handles" that could be dragged by
the user to change the shape or other characteristics of the elements?
(My B-Spline class uses interactive dragging, and it's quite neat.)

Well, this is a lot of talk, but here's the point:

I would be happy to implement this, but I need some feedback first so
that I won't code anything that some other guy already did.

Any input appreciated!

/Kristofer

PS Perhaps somebody could make a 3-D class later on? :)

--
Name:   Kristofer Maad           | "The satisfaction in making a 'crash-
Snail:  Stureg. 12A, 3tr.        |  proof' system screw up completely
        753 14 Uppsala           |  almost makes it worthwhile."  /Kris
Phone:  018-51 11 44             |
E-Mail: m93kma@student.tdb.uu.se |   


From: "Stefan Stuntz" 
Date:   Tue, 12 Mar 1996 21:48:03 +0100
X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96)
Subject: MUI Class Tree
Message-Id: <81319983@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"cLyVP3.0.iy2.eWUHn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/594
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 3678
X-Lines: 69
Status: RO

****************************************************************************
** Class Tree
****************************************************************************
**
** rootclass                    (BOOPSI's base class)
** +--Notify                   (implements notification mechanism)
** !  +--Family                (handles multiple children)
** !  !  +--Menustrip          (describes a complete menu strip)
** !  !  +--Menu               (describes a single menu)
** !  !  \--Menuitem           (describes a single menu item)
** !  +--Application           (main class for all applications)
** !  +--Window                (main class for all windows)
** !  !  \--Aboutmui           (About window of MUI preferences)
** !  +--Area                  (base class for all GUI elements)
** !     +--Rectangle          (spacing object)
** !     +--Balance            (balancing separator bar)
** !     +--Image              (image display)
** !     +--Bitmap             (draws bitmaps)
** !     !  \--Bodychunk       (makes bitmap from ILBM body chunk)
** !     +--Text               (text display)
** !     +--Gadget             (base class for intuition gadgets)
** !     !  +--String          (string gadget)
** !     !  +--Boopsi          (interface to BOOPSI gadgets)
** !     !  \--Prop            (proportional gadget)
** !     +--Gauge              (fule gauge)
** !     +--Scale              (percentage scale)
** !     +--Colorfield         (field with changeable color)
** !     +--List               (line-oriented list)
** !     !  +--Floattext       (special list with floating text)
** !     !  +--Volumelist      (special list with volumes)
** !     !  +--Scrmodelist     (special list with screen modes)
** !     !  \--Dirlist         (special list with files)
** !     +--Numeric            (base class for slider gadgets)
** !     !  +--Knob            (turning knob)
** !     !  +--Levelmeter      (level display)
** !     !  +--Numericbutton   (space saving popup slider)
** !     !  \--Slider          (traditional slider)
** !     +--Framedisplay       (private)
** !     !  \--Popframe        (private)
** !     +--Imagedisplay       (private)
** !     !  \--Popimage        (private)
** !     +--Pendisplay         (displays a pen specification)
** !     !  \--Poppen          (popup button to adjust a pen spec)
** !     +--Group              (groups other GUI elements)
** !        +--Mccprefs        (private)
** !        +--Register        (handles page groups with titles)
** !        !  \--Penadjust    (group to adjust a pen)
** !        +--Settingsgroup   (private)
** !        +--Settings        (private)
** !        +--Frameadjust     (private)
** !        +--Imageadjust     (private)
** !        +--Virtgroup       (handles virtual groups)
** !        +--Scrollgroup     (virtual groups with scrollbars)
** !        +--Scrollbar       (traditional scrollbar)
** !        +--Listview        (listview)
** !        +--Radio           (radio button)
** !        +--Cycle           (cycle gadget)
** !        +--Coloradjust     (several gadgets to adjust a color)
** !        +--Palette         (complete palette gadget)
** !        +--Popstring       (base class for popup objects)
** !           +--Popobject    (popup aynthing in a separate window)
** !           !  +--Poplist   (popup a simple listview)
** !           !  \--Popscreen (popup a list of public screens)
** !           \--Popasl       (popup an asl requester)
** +--Semaphore                (semaphore equipped objects)
**    +--Applist               (private)
**    +--Dataspace             (handles general purpose data spaces)
**       \--Configdata         (private)


From: "Stefan Stuntz" 
Date:   Sun, 18 Feb 1996 15:31:16 +0100
X-Mailer: IntuiNews 1.3b Beta 5 (3.1.96)
Subject: custom class common error
Message-Id: <81319380@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"RcVab1.0.Sw4.Dep9n"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/344
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 794
X-Lines: 31
Status: RO

Another canditate for an FAQ...

If you have a subclass of group class which internally uses
more custom classes, *never* have a dispose method like this:

ULONG dispose(...)
{
        MUI_DeleteCustomClass(data->myclass);   /******** WRONG *********/
        return(DoSuperMethodA(...));
}

Problem here is that your group class has objects created from your
custom class. These objects get deleted when the dispatcher of group
class gets the dispose method, *AFTER* your MUI_DeleteCustomClass(). It
is strictly *illegal* to delete classes with existing objects or
subclasses.

Instead, make something like this:

ULONG dispose(...)
{
        myclass = data->myclass;
        DoSuperMethodA(...);
        MUI_DeleteCustomClass(myclass);
        // *NOT* data->myclass since data is invalid here!!!
        return(0);
}

--
Greetings, Stefan


From: "Stefan Stuntz" 
Date:   Wed, 06 Mar 1996 12:51:34 +0100
X-Mailer: IntuiNews 1.3b Beta 5 (3.1.96)
Subject: Re: Area class / MUIA_Fix... Questions
Message-Id: <81319814@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"ok4wn1.0.tu1.XnNFn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/503
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 350
X-Lines: 11
Status: RO

Kai Hofmann wrote in article <60805064@informatik.uni-bremen.de>:

> But what about an attribute that will allow a fixed size for an object after
> creation time - i.e. the objects size will be calculated one time, and from
> then it can't change its size?

Write a subclass and return whatever you want during MUIM_AskMinMax.

--
Greetings, Stefan

From: "Stefan Stuntz" 
Date:   Mon, 18 Mar 1996 23:24:26 +0100
X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96)
Subject: Re: 'Console' class, anyone?
Message-Id: <81320106@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"7rFri3.0.m41.lCUJn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/689
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 734
X-Lines: 18
Status: RO

Ralph Seichter wrote in article :

> That would be a nice and clean solution, if it was possible. But I think
> the console device needs to know about window border widths etc. when a new
> console is opened.

I tried to write a console.device class a few years ago when starting
with MUI but it never really worked. Console.device is really picky
concerning windows and rastports and stuff and is not well suited for an
automatic layout system such as MUI.

What might me a better idea is a subclass of areaclass that uses this
xem library stuff (see term) to display text. I havent looked at the xem
stuff yet but I doubt the interface can be worse than console.device :)

--
Greetings, Stefan



From: m.jantz@public.ndh.com (Marcel Jantz)
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Subject: Re: Hotkeys?
In-Reply-To: 
Message-Id: <940.6678T1166T770@public.ndh.com>
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
Lines: 35
Resent-Message-Id: <"M0oJI2.0.u86.x-fSn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1062
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 36
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 941

>I have a problem (Well I have many :): If the user click on a button
>and at the time hold down a Hotkey (Shift or something) something special
>happens. How do you test if some hotkey was pressed?

>I thougt about making a MUIM_HandleInput method and then test for
>MUIKEY_POPUP, but that semed rong somehow.

I would also use MUIM_HandleInput and listen to the Mousebuttons (by
requesting them in MUIM_Setup) and then check for Qualifiers in the
inputmsg...

>I'm sure about the right way to do this. The hotkey must be user
>configurable, but if it should be configured in the MUI prefs or in my own
>I'm not sure?

>     Hans Henrik Happe


From: "Stefan Stuntz" 
Date: 	Tue, 23 Apr 1996 21:10:06 +0100
X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96)
Subject: Re: MUIKEY
Message-Id: <81321273@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"U5uKy2.0.6P6.SjIVn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1142
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 520
X-Lines: 30
Status: RO

Hi Hans!

> Wouldn't the right way of testing for MUIKEY's in the MUIM_HandleInput
> method be:
>
>     if(msg->muikey != MUIKEY_NONE)
>     {
>         switch(msg->muikey)
>         {
>             ...
>             ...
>         }
>     }
>
> instead of the way it's done in the "class3" example:
>
>     if(msg->muikey)
>     {
>         ...
>     }
>
> ???
>
> In "class3" there will be key testing for every MUIM_HandleInput call because
> MUIKEY_NONE = -1.

Stupid bug in the class3.c example.

Greetings, Stefan


From: Gilles Masson 
Message-Id: <199604251540.RAA23168@ogpsrv.unice.fr>
X-Authentication-Warning: ogpsrv.unice.fr: Host localhost didn't use HELO protocol
X-Mailer: exmh version 1.6.5 12/11/95
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Subject: Re: MUIM_DrawBackground local
Mime-Version: 1.0
Date: Thu, 25 Apr 96 17:40:00 +0200
X-Mts: smtp
Resent-Message-Id: <"A6AHR2.0.3S2.VsvVn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1150
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 46
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 1309

> MUIM_DrawBackground is rendering relative to the left, top variables in the
> MUIP_DrawBackground message. This gives bad rendering if you only want to
> update local parts of the background and is using a brush or even a pattern as
> background. I know MUIM_DrawBackground isn't a public method yet but maybee
> Stefan should consider a MUIM_UpdateBackground or something to do the above.

The res1 and res2 of struct MUIP_DrawBackground are the x and y offsets
for the drawn background, try it and you see how they work...
Don't know if Stefan had a good reason not to tell it  :-(


And Stefan, is there a way to change the value of MUIA_Background without
have it doing a MUI_Redraw object ?

currently to draw a MUII_ListCursor pattern in a part of my object,
i do something like that:

mDraw(...)
{
  LONG oldback;
  if (data->noredraw)
    return (0);
  DoSuperMethodA(..);
  ...
  ...
  data->noredraw = TRUE;
  get(obj,MUIA_Background,&oldback);
  set(obj,MUIA_Background,MUII_ListCursor);
  data->noredraw = FALSE;

  DoMethod(obj,MUIM_DrawBackground,...);

  data->noredraw = TRUE;
  set(obj,MUIA_Background,oldback);
  data->noredraw = FALSE;
  ...
  ...
}

So i don't do a redraw when i do the set(obj,MUIA_Background,...),
but there should be a nicer solution, isn't there ?


Gilles MASSON

From: Gilles Masson 
Message-Id: <199604251556.RAA23308@ogpsrv.unice.fr>
X-Authentication-Warning: ogpsrv.unice.fr: Host localhost didn't use HELO protocol
X-Mailer: exmh version 1.6.5 12/11/95
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Subject: Re: MUIA_Background problem 
In-Reply-To: Your message of "Thu, 25 Apr 96 13:18:47 +0200."
              
Mime-Version: 1.0
Date: Thu, 25 Apr 96 17:56:17 +0200
X-Mts: smtp
Resent-Message-Id: <"qCZIj1.0.6Z2._5wVn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1151
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 40
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 1423

> I`ve created a sub class "field" for a backgammon game. It`s a sub class of
> group class and represents a field of a backgammon board, e.g. a triangle
> object. The group includes 6 bodychunk objects for the stone images. So it`s
> easy to implement a drag & drop mechanism. The groups background is an image
> with the typical triangle and the bodychunk objects haven`t any background,
> so the triangle shines through. Now my problem: The group background is not
> correctly displayed, the triangle image starts not with it`s upper left
> corner. The left side of the triangle is not displayed. It looks something
> like that:

You're alllready making a custom class, so you should
set(obj,MUIA_FillArea,FALSE);
then draw yourself the background in your Draw method
with the MUIM_DrawBackground method.

#define MUIM_DrawBackground 0x804238ca /* private */ /* V11 */
struct  MUIP_DrawBackground { ULONG MethodID; LONG left; LONG top; LONG width; 
LONG height; LONG res1; LONG res2; LONG res3; }; /* private */

so something like:

DoMethod(obj,MUIM_DrawBackground,
                _mleft(obj),_mtop(obj),
                _mwidth(obj),_mheight(obj),
                x_offset,y_offset,0);

with x_offset = _mleft(obj)  or   - _mleft(obj)
 and y_offset =  _mtop(obj)  or    - _mtop(obj)

should be ok i think...



Is there a way to tell  ScrollRaster() not to clear the not scrolled
part of the area ?


Gilles MASSON


From: "Aaron Digulla" 
Date: Sun, 28 Apr 1996 14:08:03 +0100
X-Mailer: IntuiNews 1.3 (27.8.95)
Subject: Re: MUIA_Background problem 
Message-Id: <69360964@home.lake.de>
Resent-Message-Id: <"Op9hZ1.0.pk3.zSwWn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1161
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 503
X-Lines: 14
Status: RO

Gilles Masson schrieb in einer persoenlichen Nachricht ueber "Re:
MUIA_Background problem ":

> Is there a way to tell  ScrollRaster() not to clear the not scrolled
> part of the area ?

No, in that case, you must call BltBitMapRastPort() directly.

From: Gilles MASSON 
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Subject: Re: MUIA_Background problem 
In-Reply-To: Your message of "Sun, 28 Apr 96 14:08:03 BST."
             <69360964@home.lake.de> 
Mime-Version: 1.0
Date: Mon, 29 Apr 96 10:47:58 +0200
Sender: masson@iut-soph.unice.fr
X-Mts: smtp
Resent-Message-Id: <"0uri-3.0.B4.4C8Xn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1165
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 25
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 669

> Gilles Masson schrieb in einer persoenlichen Nachricht ueber "Re:
> MUIA_Background problem ":
> 
> > Is there a way to tell  ScrollRaster() not to clear the not scrolled
> > part of the area ?
> 
> No, in that case, you must call BltBitMapRastPort() directly.
> 

Not sure that BltBitMapRastPort() is a good idea in a MUI class...
nor if it will work with cybergraphx... ?

At the moment, i've found that:

oldbackfilhook = InstallLayerHook(_rp(obj)->Layer, LAYERS_NOBACKFILL);
ScrollRasterBF(_rp(obj),dx,dy,left,top,right,bottom);
InstallLayerHook(_rp(obj)->Layer, oldbackfilhook);

LAYERS_NOBACKFILL tells ScrollRasterBF to not fill the area...



Gilles MASSON


From: Jason S Birch 
Message-Id: <199604291023.SAA08262@decadence>
Subject: Custom classes made easy
To: mui@sunsite.Informatik.RWTH-Aachen.DE (MUI ML)
Date: Mon, 29 Apr 1996 18:23:10 +0800 (WST)
X-Mailer: ELM [version 2.4 PL25]
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Resent-Message-Id: <"huLEY2.0.Xi.xa9Xn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1166
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 298
Status: RO
Content-Type: text/plain; charset="US-ASCII"
Content-Length: 8396

Hi all. A few days ago I was thinking about the tedium of the
housekeeping required when creating a custom class (keeping track of
methods and attributes you've created, assigning them non-overlapping
numbers, making sure you don't forget any in the dispatcher, etc) and
decided to try and make it simpler. Inspired by VisualC++'s technique
of using the preprocessor, I had a look at that but being more
ambitious than Microsoft I quickly realized I wasn't going to be able
to do one of the more fundamental things, which was automatically keep
track of what methods and attributes had been defined and generate the
dispatcher and ID's appropriately.

So, I set out to learn flex and have come up with a preprocessor I
called mui2c. It has a fairly simple syntax, and can turn something
like this:

-------------------------

Class ( Robot :: MUIC_Area )

/* Some comment on
    the class */

This can be anything at all.

Data ( instancedata )

struct {
        long a;
        long b;
} instancedata;

Method ( OM_NEW )
{
        some stuff  {
            some more stuff
        }
}

    Method(MUIM_Robot_Test)
    {
        testing...
    }
/*
Method(MUIM_Robot_Commented)
{
    This will be ignored.
}
*/

// Method(MUIM_Robot_C++Commented)
// {
//      So will this.
// }

Method  ( OM_GET  )
{
    Attribute(MUIA_Robot_TestAttribute):public
        *store = data->a; return(TRUE);
    Attribute(MUIA_Robot_TestPrivAtt)
        *store = data->b; return(TRUE);
}

Method(OM_SET)
{
    Attribute(MUIA_Robot_TestPrivAtt)
        b = tag->ti_Data;   break;
    Attribute(MUIA_Robot_TestAttribute):public
        a = tag->ti_Data;   break;
}
-------------------------

into this:

-------------------------

/*
 * Implementation file for class Robot.
 * Automatically generated on Mon Apr 29 17:32:22 1996
 *
 */


#include "test2.h"
#include "test2p.h"
/* Some comment on
    the class */

This can be anything at all.

struct {
        long a;
        long b;
} instancedata;

static SAVEDS ULONG Robot_OM_NEW(struct IClass *cl, Object *obj, Msg msg)
{
        some stuff  {
            some more stuff
        }
}


static SAVEDS ULONG Robot_MUIM_Robot_Test(struct IClass *cl, Object *obj, Msg msg)
{
        testing...
}

/*
Method(MUIM_Robot_Commented)
{
    This will be ignored.
}
*/

// Method(MUIM_Robot_C++Commented)
// {
//      So will this.
// }

static SAVEDS ULONG Robot_OM_GET(struct IClass *cl, Object *obj, Msg msg)
{
   struct instancedata *data = INST_DATA(cl, obj);
   ULONG *store = ((struct opGet *) msg)->opg_Storage;
   ULONG tag = ((struct opGet *) msg)->opg_AttrID;

   switch (tag) {
        case MUIA_Robot_TestAttribute:
        *store = data->a; return(TRUE);
        case MUIA_Robot_TestPrivAtt:
        *store = data->b; return(TRUE);
   }
   return (DoSuperMethodA(cl, obj, msg));
}


static SAVEDS ULONG Robot_OM_SET(struct IClass *cl, Object *obj, Msg msg)
{
   struct instancedata *data = INST_DATA(cl, obj);
   struct TagItem *tags, *tag;

   for (tags = ((struct opSet *) msg)->ops_AttrList; tag = NextTagItem(&tags);) {
      switch (tag) {
        case MUIA_Robot_TestPrivAtt:
        b = tag->ti_Data;   break;
        case MUIA_Robot_TestAttribute:
        a = tag->ti_Data;   break;
      }
   }
  return (DoSuperMethodA(cl, obj, msg));
}

static SAVEDS ASM ULONG Robot_Dispatcher(REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg)
{
   switch (msg->MethodID) {
     case OM_NEW: return (Robot_OM_NEW(cl, obj, (APTR) msg));
     case MUIM_Robot_Test: return (Robot_MUIM_Robot_Test(cl, obj, (APTR) msg));
     case OM_GET: return (Robot_OM_GET(cl, obj, (APTR) msg));
     case OM_SET: return (Robot_OM_SET(cl, obj, (APTR) msg));
   }

   return (DoSuperMethodA(cl, obj, msg));
}

struct MUI_CustomClass *Robot_Create(void)
{
   return (MUI_CreateCustomClass(NULL, MUIC_Area, NULL, sizeof(struct instancedata), RobotDispatcher));
}
-------------------------

plus a couple of header files, one with public tags in it:

/*
 * Header file for class Robot.
 * Automatically generated on Mon Apr 29 17:32:22 1996
 *
 */

struct MUI_CustomClass *Robot_Create(void);

/* PUBLIC METHODS */


/* PUBLIC ATTRIBUTES */
#define MUIA_Robot_TestAttribute		0x1b5f0001

and one with private tags:

/*
 * Private header file for class Robot.
 * Automatically generated on Mon Apr 29 17:32:22 1996
 *
 */



/* PRIVATE METHODS */
#define MUIM_Robot_Test		0x1b5f0000


/* PRIVATE ATTRIBUTES */
#define MUIA_Robot_TestPrivAtt		0x1b5f0002

-----------------------

Ok, now, after having done this, I have a few questions I'd like to
ask of people who might be interested in a (free) program like this.
First, what do you think of the syntax? Currently it looks like this:

Class(Classname::Superclass)
Data(InstanceDataName)

Method(SomeMethodName)[:public]
...
Method(OM_GET)
{
   Attribute(SomeAttributeName)[:public]
   [...] return(TRUE);
}
...
Method(OM_SET)
{
   Attribute(SomeAttributeName)[:public]
   [...] break;
}
...

etc. Personally, I'm not too keen on the syntax (it seemed like a good
idea at the time, but after actually trying it out it looks a bit
funny) so I'm open to suggestions. Currently it is fairly resilient --
the odd spacings I placed in the test file were to illustrate what
matters and what doesn't. I'd also like to know how people would like
to indicate the base tag value to generate the rest from -- somehow a
"BaseValue(nnn)" doesn't seem right, but if people don't care then I
can do something like that.

As you might have guessed, attributes may only be specified within an
OM_GET or an OM_SET method. Currently, if someone declares one
definition (eg. in OM_GET) to be public and the other to not, it
simply generates the tag in the public file and doesn't do anything
fancy to stop external users. All other methods just use a standard
header. An alternative syntax for attributes might be something like:

Attribute(SomeAttribute)
{
	Get: {blah}
	Set: {blah}
}

and let the OM_GET and OM_SET methods be generated accordingly.

Normal source code (and comments -- it understands nested comments,
too) can be included anywhere and will simply be copied through, so if
you want to do any fancy tricks that should be ok. Also, within a
Method(){..}, you'll always have at least "cl", "obj", and "msg"
available (much like "this" in C++) with perhaps "data" as well.
Additionally, within an OM_GET and OM_SET there are a few others.
Would you prefer not to have these automatically available? Would
you prefer different names?

A limitation I enforced (which can be removed if I use { and } to
delimit the class) is there can be only one class definition per file.
I also made all function definitions static to ensure no accidental
name clashes, although with the class name prepended this is unlikely.
It does add security, though.

A trick I used to work out which methods and attributes should have
tags given without having to search through all the include files and
see what was already defined was to decide that only tags starting
with MUIM__ and MUIA__ should be considered
belonging to the class, and everything else is assumed to be defined
elsewhere (eg. OM_GET).

The actual code generated is simply taken from a big list of strings.
Provided another language has a similar structure, I see no reason why
eg. E or Modula strings couldn't be used instead to output the code in
the language of choice. If someone wanted to support this, then I can
make the program read the strings from a seperate file, or build them
in and make the selection a commandline option. Also, if someone has
better strings than mine, let me know. :-)

That'll do for now. If you want to try it out, grab the file
http://www.cs.uwa.edu.au/~jasonb/mui2c.lha. Mail me (or the list) any
comments, suggestions, or criticisms you might have. This is more a
proof-of-concept than a finished idea, so there's plenty of room for
improvement. I just want to get a little feedback on what people want
(if anything) before I spend too much more time on this.

The lha archive is 19k, the executeable is about 35k.

Cheers,
Jason.

-- 
Jason S Birch                        ,-_|\ email: jasonb@cs.uwa.edu.au
Department of Computer Science      /     \ Tel (work): +61 9 380 1840
The University of Western Australia *_.-._/ Fax (work): +61 9 380 1089
Nedlands  W. Australia  6907             v  Tel (home): +61 9 386 8630

From: McBoe@abyss.apl.s.shuttle.de (Jens Boenisch)
Subject: Re: MUIA_Background problem
Message-Id: <227912f5.u7t157e.8d9a4-McBoe@abyss.apl.s.shuttle.de>
Date: Mon, 29 Apr 1996 23:34:00 GMT
Resent-Message-Id: <"9_AgU2.0.Bl4.blNXn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1173
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 803
X-Lines: 30
Status: RO

Hi Gilles (Gilles MASSON), in <199604290848.KAA06110@ogpsrv.unice.fr> on Apr 29 you wrote:

> Not sure that BltBitMapRastPort() is a good idea in a MUI class...

Indeed. ClipBlit is a better one.

> nor if it will work with cybergraphx... ?

It will, like every other Function of graphics.library, work.

> At the moment, i've found that:
> 
> oldbackfilhook = InstallLayerHook(_rp(obj)->Layer, LAYERS_NOBACKFILL);
> ScrollRasterBF(_rp(obj),dx,dy,left,top,right,bottom);
> InstallLayerHook(_rp(obj)->Layer, oldbackfilhook);

Mh, sounds crazy :)

The suggested code for fast scrolling without clearing the old area looks
like this:

ClipBlit(_rp(obj),...);
oldMask = SetWriteMask (_rp(obj), 0);
ScrollRaster (_rp(obj),dx,dy,left,top,right,bottom);
SetWriteMask (_rp(obj), oldMask);

So short ...

	Jens

From: Gilles MASSON 
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Subject: Re: MUIA_Background problem 
In-Reply-To: Your message of "Mon, 29 Apr 96 23:34:00 GMT."
             <227912f5.u7t157e.8d9a4-McBoe@abyss.apl.s.shuttle.de> 
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Date: Thu, 02 May 96 18:56:01 +0200
Sender: masson@iut-soph.unice.fr
X-Mts: smtp
Resent-Message-Id: <"ScoMs2.0.Dg5.KdEYn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1195
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 37
Status: RO
Content-Type: text/plain; charset="iso-8859-1"
Content-Length: 909

> > oldbackfillhook =3D InstallLayerHook(_rp(obj)->Layer, LAYERS_NOBACKFI=
LL);
> > ScrollRasterBF(_rp(obj),dx,dy,left,top,right,bottom);
> > InstallLayerHook(_rp(obj)->Layer, oldbackfillhook);
> =

> Mh, sounds crazy :)
> =

> The suggested code for fast scrolling without clearing the old area loo=
ks
> like this:
> =

> ClipBlit(_rp(obj),...);

works ok, but don't seem to be quicker than my ScrollRasterBF,
(i tested with AGA and CGFX). =

I think the only change is the time used by the InstallLayerHook(),
which should be short.

> oldMask =3D SetWriteMask (_rp(obj), 0);
> ScrollRaster (_rp(obj),dx,dy,left,top,right,bottom);
> SetWriteMask (_rp(obj), oldMask);

This one don't scroll anything !


A good way could be to do a good SetWriteMask() for the chipset,
but it's no good with user defined mui backgrounds ! (can't know
which bitplanes are really used) So it's not good  :-(


Gilles MASSON

From: McBoe@abyss.apl.s.shuttle.de (Jens Boenisch)
Subject: Re: MUIA_Background problem
Message-Id: <227d8a96.u7t157e.9c42-McBoe@abyss.apl.s.shuttle.de>
Date: Fri, 03 May 1996 08:53:00 GMT
Resent-Message-Id: <"VyTB12.0.sw4.I_YYn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1198
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 1134
X-Lines: 34
Status: RO

Hi Gilles (Gilles MASSON), in <199605021656.SAA23463@ogpsrv.unice.fr> on May 02 you wrote:

> > ClipBlit(_rp(obj),...);
> 
> works ok, but don't seem to be quicker than my ScrollRasterBF,
> (i tested with AGA and CGFX). 
> I think the only change is the time used by the InstallLayerHook(),
> which should be short.

I haven't tested it, but if this takes the same amount of time
like InstallClipRegion() it is rather expensive ...

Another advantage of my code is, that it works with OS2 too.

> > oldMask = SetWriteMask (_rp(obj), 0);
> > ScrollRaster (_rp(obj),dx,dy,left,top,right,bottom);
> > SetWriteMask (_rp(obj), oldMask);
> 
> This one don't scroll anything !

Of course doesn't it scroll any Bitplanes but it scrolls the damage regions
and this is the only intention of this three lines.

> A good way could be to do a good SetWriteMask() for the chipset,
> but it's no good with user defined mui backgrounds ! (can't know
> which bitplanes are really used) So it's not good  :-(

When you know, what you are doing a WriteMask (rp, 0) can be a good
idea. And in the above example it *is* a good idea.

So short ...

	Jens

From: "Stefan Stuntz" 
Date: 	Sat, 11 May 1996 11:28:13 +0100
X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96)
Subject: Re: drawing Bitmap and Bodychunk in rastport ?
Message-Id: <81322055@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"5MCNi3.0.O21.yt5bn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1265
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 351
X-Lines: 12
Status: RO

Gilles MASSON wrote in article <199605091536.RAA22282@ogpsrv.unice.fr>:

> How could i draw in my custom class rastport some image
> of Bitmap object or Bodychunk object, like it's done
> in MUI_List with MUIM_List_CreateImage ?

Make your class subclass of group class, use a custom layout hook and
place Bitmap objects there.

--
Greetings, Stefan


Subject: MCP MCC_GetClass() function ?
Mime-Version: 1.0
Date: Mon, 20 May 96 13:54:42 +0200
Sender: masson@iut-soph.unice.fr
X-Mts: smtp
Resent-Message-Id: <"0j-oR.0.sD.ku5en"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1368
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 22
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 613


My mcc and mcp code work, but i have some questions with
MCC_GetClass()/MCC_Query() function. (i've seen both names).

my tests with existing mcc/mcp (Busy,Listtree...) and kmel mcc
example source show me that :

For MCC class:
MCC_Query(0)  return the mcc class ptr... ok.
MCC_Query(1) and MCC_Query(2) return 0, ok.
MCC_Query(3)  return 1... *** WHY ??? ***

For MCP class:
MCC_Query(0)  return a class ptr... *** WHICH ONE and WHY ??? ***
MCC_Query(1)  return the mcp class ptr... ok.
MCC_Query(2)  return NULL or a Bitmap/Bodychunk object ptr, ok.
MCC_Query(3)  return 0... *** WHY ??? ***


Gilles MASSON

Subject: Re: public mcc...[ libnix libinit.c ]
Resent-Message-Id: <"udXdc2.0.HY4.x5Ven"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1371
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 1358
X-Lines: 39
Status: RO

Hello all,

On 21-May-96, Gilles MASSON wrote:

> > I did the MCC UserData Example with gcc. I have used the library code of
> > the libnix-package. The only real Problem was the register a4. (Dataspace)
> > 
> Anyway, i have done changes to libinit.c and mccheader.c (from kmel)
> and succeed to make a non baserel stuff for mcc/mcp with gcc, so you
> don't have to deal with a4 and it's easier (code is bigger and slower
> anyway of course) and it's work well.
> you can get it on ftp://bibliut.unice.fr/amiga/mui/gcc_mcc10.lha
> 
I have also written an adapted version of libinit.c with these features:

- baserelative
- __UserLibOpen/Close() calls
- global dataspace available in Open/Close
- multithreading allowed in Open/Close(), i.e. I can do DOS I/O, or
  even spawn a library thread that shares the global data space.
- semaphore and protected by fake opener.

I'm now adapting it for a device frontend, datatype frontend, and maybe
the MUI stuff, although I need some input on the latter.

I will put it on my homepage as "dd_libinit.c" - sources and stuff included.

http://www.stack.urc.tue.nl/~leon/

Should be available when you read this.

Regards,
--
Leon `LikeWise' Woestenberg  
Information Technology Science student, Eindhoven University of Technology.

Subject: Re: public mcc...[ libnix libinit.c ]
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Date: Wed, 22 May 1996 17:09:07 +0200 (MET DST)
In-Reply-To: <199605221407.QAA10192@ogpsrv.unice.fr> from "Gilles MASSON" at May 22, 96 04:07:01 pm
X-Mailer: ELM [version 2.4 PL24]
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Resent-Message-Id: <"fMU2P.0.By5.cuoen"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1377
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 22
Status: RO
Content-Type: text/plain; charset="US-ASCII"
Content-Length: 690


Hello all,
> 
> > I'm now adapting it for a device frontend, datatype frontend, and maybe
> > the MUI stuff, although I need some input on the latter.
> 
> Is it really intersting to make MCC/MCP baserelative ?
>
No. The dd_libinit.c was not especially written for MCC/MCP; it was more
an alternative to the rather simple libnix libinit.c, which didn't support
Open/Close() at all. 

I'm not familiar with programming public classes for MUI, but I'm very much
interested in writing a libinit.c skeleton for it.

> They should have very few global datas and a4 seems to be a
> problematic stuff which is little used in fact.
>
What is the problematic item regarding a4?
 
Greetings, Leon.


Subject: RE: re: mcc ... [libnix libinit.c]
Message-Id: <960522201849_101526.3324_IHK86-1@CompuServe.COM>
Resent-Message-Id: <"Feo4D2.0.-w.1Uten"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1383
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 1441
X-Lines: 34
Status: RO

> Hello all,
> > 
> > > I'm now adapting it for a device frontend, datatype frontend, and maybe
> > > the MUI stuff, although I need some input on the latter.
> > 
> > Is it really intersting to make MCC/MCP baserelative ?
> >
> No. The dd_libinit.c was not especially written for MCC/MCP; it was more
> an alternative to the rather simple libnix libinit.c, which didn't support
> Open/Close() at all. 
> 
> I'm not familiar with programming public classes for MUI, but I'm very much
> interested in writing a libinit.c skeleton for it.
>
It is rather simple to program a public MUI class. Look at the example in the
developers package.
A skeleton for a public MUI class is a very good idea. (I had already the same
in my mind, but I think I have no time to do it.) Let me explain my idea of
this task:
- I don't think that there is a need for Open/Close in public MUI classes.
- The only thing the skeleton should do is, Open muimaster.library and making
  MUIMasterBase, UtilityBase, DOSBase and IntuitionBase globally visible.
  (there is the need for a4, if baserel). Functions from these Libraries are
  usually called in MUI classes.
- the skeleton should only take reference to the dispatcher function and struct
  data.
- the library code could be kept really simple. probably in assembler. maybe
  below 100 bytes??



Willi Burkhardt 				  101526.3324@compuserve.com
		      -------> I will have a new address in a few weeks ....

Subject: RE: re: mcc ... [libnix libinit.c]
Resent-Message-Id: <"puFHJ.0.Zo4.DDjfn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1399
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 2347
X-Lines: 53
Status: RO

Hi all,

On 23-May-96, Willi wrote:

> > an alternative to the rather simple libnix libinit.c, which didn't support
> > Open/Close() at all. 
> > 
> > I'm not familiar with programming public classes for MUI, but I'm very much
> > interested in writing a libinit.c skeleton for it.
> >
> It is rather simple to program a public MUI class. Look at the example in the
> developers package.
> A skeleton for a public MUI class is a very good idea. (I had already the same
> in my mind, but I think I have no time to do it.) Let me explain my idea of
> this task:
> - I don't think that there is a need for Open/Close in public MUI classes.
> - The only thing the skeleton should do is, Open muimaster.library and making
>   MUIMasterBase, UtilityBase, DOSBase and IntuitionBase globally visible.
>   (there is the need for a4, if baserel). Functions from these Libraries are
>   usually called in MUI classes.
>
"Opening muimaster.library" does implicitly need Open/Close, as it breaks
single-threading. (It does DOS file I/O, and Wait()s). This means the
muimaster.library must be opened in Open(), but only once, i.e. when the
usercount goes from 0 to 1. There is confusion whether ramlib is able
to sequentialize everything ok. (page 65, The Amiga Guru Book). I think
I'll ask again at c.s.a.programmer, but last time I did, a discussion
broke lose, among advanced programmers, even some that are developing
the next AmigaOS right now...

> - the skeleton should only take reference to the dispatcher function and struct
>   data.
Yes, that's right. It must only make things easier for the programmer,
but not must limit the class' capabilities by restrictions.

> - the library code could be kept really simple. probably in assembler. maybe
>   below 100 bytes??
> 
I have a library skeleton that has the same protection scheme as the
adapted libinit.c. However, it doesn't set up C specific stuff such as
a4 global data pointers. It was 300 to 400 bytes. The libnix adapted
skeleton is 900 bytes. IMHO, we should stick with the C source for a
while, until we get the skeleton worked out. A conversion into assembler
is always possible later.

Regards,
--
Leon `LikeWise' Woestenberg  
Information Technology Science student, Eindhoven University of Technology.

Subject: custom class skeleton
Message-Id: <81322388@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"pNl113.0.Ue4.f-tgn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1422
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 9571
X-Lines: 432
Status: RO

Hi!

Following the recent discussions about library skeletons, I use one
completely written in C for all my MUI classes. I plan to clean up,
document and release it some day. If you are willing to try it now
without comments and docs, here we go. You need to define a few things
like CLASS and SUPERCLASS and your Data structure and then include the
module before any other code. Well, I'm sure you'll find out what to
do...


/* mccheader.c */

#include 
#include 
#include 
#include 
#include 

#include 

#include 
#include 

static const char UserLibName[] = CLASS;

struct Library *MUIClassBase;
struct Library *MUIMasterBase;
struct Library *MUIGfxBase;
struct Library *MUILowLevelBase;
struct Library *SysBase;
struct Library *UtilityBase;
struct Library *DOSBase;
struct Library *GfxBase;
struct Library *IntuitionBase;

#ifdef SUPERCLASS
struct MUI_CustomClass *ThisClass;
#endif

#ifdef SUPERCLASSP
struct MUI_CustomClass *ThisClassP;
#endif


#ifdef _DCC

#define REG(x) __ ## x
#define ASM
#define SAVEDS __geta4

#else

#define REG(x) register __ ## x
#define ASM    __asm
#define SAVEDS __saveds

#endif



/******************************************************************************/
/* External references                                                        */
/******************************************************************************/

BOOL ASM UserLibInit   (REG(a6) struct Library *base);
BOOL ASM UserLibExpunge(REG(a6) struct Library *base);
BOOL ASM UserLibOpen   (REG(a6) struct Library *base);
BOOL ASM UserLibClose  (REG(a6) struct Library *base);

extern void kprintf(const char *, ...);


/******************************************************************************/
/* Structures                                                                 */
/******************************************************************************/

struct LibraryHeader
{
	struct Library         lh_Library;
	BPTR                   lh_Segment;
	struct SignalSemaphore lh_Semaphore;
};

struct LibraryHeader * ASM LibInit   (REG(a0) BPTR Segment);
BPTR                   ASM LibExpunge(REG(a6) struct LibraryHeader *base);
struct LibraryHeader * ASM LibOpen   (REG(a6) struct LibraryHeader *base);
BPTR                   ASM LibClose  (REG(a6) struct LibraryHeader *base);
LONG                   ASM LibNull   (VOID);
ULONG           SAVEDS ASM MCC_Query (REG(d0) LONG which);

static const APTR LibVectors[] =
{
	LibOpen,
	LibClose,
	LibExpunge,
	LibNull,
	MCC_Query,
	(APTR)-1
};



/******************************************************************************/
/* Dummy entry point and LibNull() function all in one                        */
/******************************************************************************/

LONG ASM LibNull(VOID)
{
	return(NULL);
}


static const struct Resident ROMTag =
{
	RTC_MATCHWORD,
	&ROMTag,
	&ROMTag + 1,
	0,
	VERSION,
	NT_LIBRARY,
	0,
	UserLibName,
	UserLibID,
	LibInit
};

#ifdef MYDEBUG
#define LIBHEADER
#include "debug.c"
#endif



/******************************************************************************/
/* Standard Library Functions, all of them are called in Forbid() state.      */
/******************************************************************************/

struct LibraryHeader * ASM SAVEDS LibInit(REG(a0) BPTR Segment)
{
	struct LibraryHeader *base;

	SysBase = *((struct Library **)4);

	D(DBF_LIB,bug("start...\n"));

	#ifdef __SASC
	#ifdef _M68040
	if (!(((struct ExecBase *)SysBase)->AttnFlags & AFF_68040))
		return(NULL);
	#endif
	#ifdef _M68030
	if (!(((struct ExecBase *)SysBase)->AttnFlags & AFF_68030))
		return(NULL);
	#endif
	#ifdef _M68020
	if (!(((struct ExecBase *)SysBase)->AttnFlags & AFF_68020))
		return(NULL);
	#endif
	#endif

	if (base = (struct LibraryHeader *)MakeLibrary((APTR)LibVectors,NULL,NULL,sizeof(struct LibraryHeader),NULL))
	{
		base->lh_Library.lib_Node.ln_Type = NT_LIBRARY;
		base->lh_Library.lib_Node.ln_Name = (char *)UserLibName;
		base->lh_Library.lib_Flags        = LIBF_CHANGED | LIBF_SUMUSED;
		base->lh_Library.lib_Version      = VERSION;
		base->lh_Library.lib_Revision     = REVISION;
		base->lh_Library.lib_IdString     = (char *)UserLibID;

		base->lh_Segment  = Segment;

		InitSemaphore(&base->lh_Semaphore);

		AddLibrary((struct Library *)base);
	}
	else
	{
		D(DBF_LIB,bug("\7MakeLibrary() failed\n"));
	}

	return(base);
}


BPTR ASM SAVEDS LibExpunge(REG(a6) struct LibraryHeader *base)
{
	struct Library *SysBase = *((struct Library **)4);
	BPTR rc;

	D(DBF_LIB,bug("OpenCount=%ld\n",base->lh_Library.lib_OpenCnt));

	if (base->lh_Library.lib_OpenCnt)
	{
		base->lh_Library.lib_Flags |= LIBF_DELEXP;
		D(DBF_LIB,bug("Setting LIBF_DELEXP\n"));
		return(NULL);
	}

	Remove((struct Node *)base);
	rc = base->lh_Segment;
	FreeMem((BYTE *)base - base->lh_Library.lib_NegSize,base->lh_Library.lib_NegSize + base->lh_Library.lib_PosSize);

	return(rc);
}


struct LibraryHeader * ASM SAVEDS LibOpen(REG(a6) struct LibraryHeader *base)
{
	struct Library *SysBase = *((struct Library **)4);
	struct LibraryHeader *rc;

	base->lh_Library.lib_OpenCnt++;
	base->lh_Library.lib_Flags &= ~LIBF_DELEXP;

	D(DBF_LIB,bug("OpenCount=%ld\n",base->lh_Library.lib_OpenCnt));

	ObtainSemaphore(&base->lh_Semaphore);

	if (UserLibOpen((struct Library *)base))
	{
		rc = base;
	}
	else
	{
		rc = NULL;
		base->lh_Library.lib_OpenCnt--;
		D(DBF_LIB,bug("\7UserLibOpen() failed\n"));
	}

	ReleaseSemaphore(&base->lh_Semaphore);

	return(rc);
}


BPTR ASM SAVEDS LibClose(REG(a6) struct LibraryHeader *base)
{
	struct Library *SysBase = *((struct Library **)4);
	BPTR rc = NULL;

	D(DBF_LIB,bug("OpenCount=%ld %s\n",base->lh_Library.lib_OpenCnt,base->lh_Library.lib_OpenCnt==0 ? "\7ERROR" : ""));

	ObtainSemaphore(&base->lh_Semaphore);
	UserLibClose((struct Library *)base);
	ReleaseSemaphore(&base->lh_Semaphore);

	if (--base->lh_Library.lib_OpenCnt == 0)
	{
		if (base->lh_Library.lib_Flags & LIBF_DELEXP)
		{
			rc = LibExpunge(base);
		}
	}

	return(rc);
}






BOOL ASM SAVEDS UserLibOpen(REG(a6) struct Library *base)
{
	ULONG ASM _Dispatcher(REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg);
	ULONG ASM _DispatcherP(REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg);
	BOOL ClassInitFunc(struct Library *base);

	D(DBF_CLASS,bug("%ld\n",base->lib_OpenCnt));

	if (base->lib_OpenCnt==1)
	{
		if (MUIMasterBase = OpenLibrary("muimaster.library",libversion(base)))
		{
			if (MUIGfxBase = OpenLibrary("muigfx.library",libversion(base)))
			{
				if (MUILowLevelBase = OpenLibrary("muilowlevel.library",libversion(base)))
				{
					#ifdef SUPERCLASS
					if (ThisClass = MUI_CreateCustomClass(base,SUPERCLASS,NULL,sizeof(struct Data),_Dispatcher))
					#endif
					{
						BOOL res;

						#ifdef SUPERCLASSP
						ThisClassP = MUI_CreateCustomClass(base,SUPERCLASSP,NULL,sizeof(struct DataP),_DispatcherP);
						#endif

						#ifdef SUPERCLASS
						UtilityBase   = ThisClass->mcc_UtilityBase;
						DOSBase       = ThisClass->mcc_DOSBase;
						GfxBase       = ThisClass->mcc_GfxBase;
						IntuitionBase = ThisClass->mcc_IntuitionBase;
						#else
						UtilityBase   = ThisClassP->mcc_UtilityBase;
						DOSBase       = ThisClassP->mcc_DOSBase;
						GfxBase       = ThisClassP->mcc_GfxBase;
						IntuitionBase = ThisClassP->mcc_IntuitionBase;
						#endif

						#ifdef ClassInit
						res = ClassInitFunc(base);
						#else
						res = TRUE;
						#endif

						if (res)
						{
							return(TRUE);
						}

						#ifdef SUPERCLASSP
						if (ThisClassP)
							MUI_DeleteCustomClass(ThisClassP);
						#endif

						#ifdef SUPERCLASS
						MUI_DeleteCustomClass(ThisClass);
						#endif
					}
					CloseLibrary(MUILowLevelBase);
				}
				CloseLibrary(MUIGfxBase);
			}
			CloseLibrary(MUIMasterBase);
		}
		D(DBF_CLASS,bug("fail.: %08lx %s\n",base,base->lib_Node.ln_Name));

		#ifdef SUPERCLASS
		ThisClass     = NULL;
		#endif

		#ifdef SUPERCLASSP
		ThisClassP    = NULL;
		#endif

		MUIMasterBase = NULL;
		MUIGfxBase    = NULL;
		UtilityBase   = NULL;
		DOSBase       = NULL;
		GfxBase       = NULL;
		IntuitionBase = NULL;

		return(FALSE);
	}
	return(TRUE);
}


BOOL ASM SAVEDS UserLibClose(REG(a6) struct Library *base)
{
	VOID ClassExitFunc(struct Library *base);

	D(DBF_CLASS,bug("%ld\n",base->lib_OpenCnt));

	if (base->lib_OpenCnt==1)
	{
		#ifdef ClassExit
		ClassExitFunc(base);
		#endif

		#ifdef SUPERCLASSP
		if (ThisClassP)
			MUI_DeleteCustomClass(ThisClassP);
		#endif

		#ifdef SUPERCLASS
		if (ThisClass)
			MUI_DeleteCustomClass(ThisClass);
		#endif

		if (MUILowLevelBase)
			CloseLibrary(MUILowLevelBase);

		if (MUIGfxBase)
			CloseLibrary(MUIGfxBase);

		if (MUIMasterBase)
			CloseLibrary(MUIMasterBase);

		#ifdef SUPERCLASS
		ThisClass       = NULL;
		#endif

		#ifdef SUPERCLASSP
		ThisClassP      = NULL;
		#endif

		MUILowLevelBase = NULL;
		MUIMasterBase   = NULL;
		MUIGfxBase      = NULL;

		UtilityBase     = NULL;
		DOSBase         = NULL;
		GfxBase         = NULL;
		IntuitionBase   = NULL;
	}
	return(TRUE);
}


ULONG SAVEDS ASM MCC_Query(REG(d0) LONG which)
{
	switch (which)
	{
		#ifdef SUPERCLASS
		case 0: return((ULONG)ThisClass);
		#endif

		#ifdef SUPERCLASSP
		case 1: return((ULONG)ThisClassP);
		#endif

		#ifdef PREFSIMAGEOBJECT
		case 2:
		{
			Object *obj = PREFSIMAGEOBJECT;
			return((ULONG)obj);
		}
		#endif

		#ifdef ONLYGLOBAL
		case 3:
		{
			return(TRUE);
		}
		#endif
	}
	return(NULL);
}


Subject: Re: mcc ... [libnix libinit.c]
Date: 02 Jun 1996 13:56:31
References: <960528184901_101526.3324_IHK161-1@CompuServe.COM>
Organization: I&S Informatica e Servizi
X-Newsreader: MM v1.2x *UNREG*/NetGate 1.2a
Mime-Version: 1.0
Content-Transfer-Encoding: QUOTED-PRINTABLE
Resent-Message-Id: <"hzT633.0.yM1.xTWin"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1462
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 80
Status: RO
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Type: TEXT/PLAIN; charset="ISO-8859-1"
Content-Length: 2644

Hello Willi,
in a message dated 28 May 96 you wrote to :

 W> The skeleton should only OpenLibrary() and of course CloseLibrary() the
 W> muimaster.library. since muimaster opens Dos, Utility, intuition [...]

You may need other libraries as well, for example Layers or Diskfont.

 W> To set up a4 is only necessary for baserelative code! Since the
 W> above mentioned Library bases are the only global variables in
 W> a MUI class, I think it is easier not to do it baserelative.

Well, in fact you can also have the library base pointers as members of
your own library base, so you don't really need *any* static data (except
constant data, maybe). You have to do something like this:

  struct MyLibBase
  {
    struct Library LibNode;
    ...

    struct MUI_CustomClass *my_Class;

    struct ExecBase *my_SysBase;
    struct Library  *my_MUIMasterBase;
    ...
  };

  #define SysBase       (my->my_SysBase)
  #define MUIMasterBase (my->my_MUIMasterBase)

This works for sure with SAS/C: of course you have to #include the pragmas
for all the libraries you need, but you should do it anyway...

The only drawback is: any of your functions that calls a library function
needs to get a pointer to your library base, and it has to be called "my".
But this is easy to do:

  VOID myFunction(, struct MyLibBase *my)
  {
    ...
  }

With callback hooks you could pass your library base in the h_Data field,
and retrieve it as the first thing you do:

  ASM VOID myHook(REG(a0) struct Hook *h,
    REG(a1) APTR msg, REG(a2) Object *obj)
  {
    struct MyLibBase *my =3D (struct MyLibBase *)h->h_Data;
    ...
  }

Since you will most probably have a pointer to your MUI custom class in the
library base as well, you could access the library base pointers in it with
another #define:

  #define UtilityBase (my->my_Class->mcc_UtilityBase)

It would be more efficient to have them directly in the library base,
though... You choose.

 W> To stick with the C source until we get a skeleton worked out [...]

I do have a skeleton based on MuiClassHeader.c (and I will incorporate any
intresting ideas found in the skeleton posted recently by Stefan -- I will
have a look at it today). Some small parts are in assembly, but that's
inavoidable if you want to be really sure about what pieces of code get
where; having everything in C is potentially dangerous, because no compiler
does guarantee where functions and/or data will go in the object file.

Ciao,
        Flavio

Subject: Re: custom class skeleton
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Date: Mon, 3 Jun 1996 11:14:32 +0800 (WST)
In-Reply-To: <199606022127.XAA113632@venere.inet.it> from "Flavio Stanchina" at Jun 2, 96 02:19:12 pm
X-Mailer: ELM [version 2.4 PL25]
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Resent-Message-Id: <"ouRTm2.0.jb2.fZbin"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/1469
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
X-Lines: 63
Status: RO
Content-Type: text/plain; charset="US-ASCII"
Content-Length: 2507

> not detailed enough. For example, I didn't find any information on what you
> can or cannot do in the MUIM_Draw method: it happens that I change rastport
> drawing pens and/or drawmode and some MUI objects get rendered incorrectly
> thereafter. Do I always have to clone the rastport?

I think you can do anything you like so long as you restore the
settings before the end of MUIM_Draw.
 
> Then, what about clipping? Do I have to do something special to install my
> own clip region(s)? I tried a simple InstallClipRegion(), and restored the
> original clip region as soon as I was done, but objects didn't graphically
> react to mouse actions any more.

Inside your MUIM_Draw method, have something along the lines of:

APTR clip = MUI_AddClipping(muiRenderInfo(obj), left, top, width,
height);

where (left, top) are the starting co-ordinates, and (0,0) is the top
left of the object's area. width is the width of the clipping region,
and height is its height.

When you have finished (again, still inside MUIM_Draw) you do:

MUI_RemoveClipping(muiRenderInfo(obj), clip);

Note that clip is the handle that was originally returned by
MUI_AddClipping(). That's it. You can nest clippings simply by calling
it again (with a different handle), MUI will take care of combining
them.

You can also use a struct ClipRegion. Here are Stefan's notes on the
subject:

APTR MUI_AddClipping      (struct MUI_RenderInfo *mri,WORD left,WORD top,WORD width,WORD height);
VOID MUI_RemoveClipping   (struct MUI_RenderInfo *mri,APTR handle);

and

APTR MUI_AddClipRegion    (struct MUI_RenderInfo *mri,struct Region *r);
VOID MUI_RemoveClipRegion (struct MUI_RenderInfo *mri,APTR handle);

do basically the same, once with coordinates and once with a struct Region.
Note that after MUI_AddClipRegion, you no longer need to worry about
freeing the structure, MUI_RemoveClipRegion will do this for you.

The MUI_AddXXX return a handle which must be passed to the MUI_RemoveXXX
function call. Adding clip regions cannot fail. You can nest clip regions,
MUI will automatically take care of that and "AND" new regions to existing
ones. Thus, the clipping calls work fine in virtual groups.
 
> Ciao,
>         Flavio

Cheers,
Jason.

Subject: Picture.mcc problem...
Date: 10 Jun 1996 18:34:30
Organization: primalinea & ESS software
X-Newsreader: MM v1.2x/p #1041/NetGate 1.2a
MIME-Version: 1.0
Content-Transfer-Encoding: QUOTED-PRINTABLE
Resent-Message-ID: <"h0tpq.0.nz2.vO7ln"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1518
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 215
Status: RO
Content-Type: TEXT/PLAIN; charset="ISO-8859-1"
Content-Length: 5435


HI!

I'm writing an external class that can show a picture.  This class use the
Datatypes.   The  class,  if MUI_PICTURE_Stretch is set to TRUE, scale the
image to fit in the area of the object.

I'm  using BitMapScale(bsa) function  to  do  this but when I try to run my
application  in  true  color and scale a 24bit colour bitmap, the function
fail.

In  256  color  mode  (or  less),  BitMapScale(bsa),  work (the picture is
scaled),  but  the  variable  "width"  in mNew(), is reset to -1 after the
call.

I'm using Cybergfx 2.18 and PDT v43.

Where I go wrong?

//Includes
//********
#include 
#include 
#include 
#include 

struct AlienImage
{	APTR obj;
	APTR bitmap;
};

struct Data
{
	char *File;
	BOOL Stretch;

	struct AlienImage *img;
#ifdef DEBUG
	BPTR	debug;
#endif
};


struct AlienImage *CaricaImmagine(struct MUI_RenderInfo *,char *);
void RilasciaImmagine(struct AlienImage *);

static ULONG mDraw(     struct IClass *cl,
                        Object *obj,
                        struct MUIP_Draw *msg)
{
   struct Data *data =3D INST_DATA(cl,obj);
	char pippo[200];
	ULONG width,height;
	ULONG bmpWidth,bmpHeight,bmpDepth;

   DoSuperMethodA(cl,obj,(Msg)msg);

   if (msg->flags & MADF_DRAWOBJECT)
   {	if (data->img) RilasciaImmagine(data->img);
		data->img=3DCaricaImmagine(muiRenderInfo(obj),"dati:disegni/primalin.gif"=
);
		if (!(data->img))
		{	DisplayBeep(0);
   	}
	}

	bmpWidth=3DGetBitMapAttr(data->img->bitmap,BMA_WIDTH);
	bmpHeight=3DGetBitMapAttr(data->img->bitmap,BMA_HEIGHT);
	bmpDepth=3DGetBitMapAttr(data->img->bitmap,BMA_DEPTH);

	if (data->Stretch)
	{	struct BitScaleArgs *bsa;
		struct BitMap *tmpBMP=3DNULL;
		=
		width=3D_mwidth(obj);									// Larghezza dell'oggetto
		height=3D_mheight(obj);								// Altezza dell'oggetto

#ifdef DEBUG
		sprintf(pippo,"%d %d %d\n",	bmpWidth,
												bmpHeight,
												bmpDepth);
		Write(data->debug,pippo,strlen(pippo));

		sprintf(pippo,"%d %d\n",		ScalerDiv(width,width,bmpWidth),
												ScalerDiv(height,height,bmpHeight));
		Write(data->debug,pippo,strlen(pippo));
#endif

		tmpBMP=3DAllocBitMap(  width,
									height,
									bmpDepth,
									BMF_INTERLEAVED|BMF_CLEAR,
									NULL);

		if (!tmpBMP)
		{	DisplayBeep(0);
			return(0);
		}

		bsa=3DAllocVec(sizeof (struct BitScaleArgs),MEMF_CLEAR);
		if (!bsa)
		{	DisplayBeep(0);DisplayBeep(0);
			FreeBitMap(tmpBMP);
			return(0);
		}

		bsa->bsa_SrcX=3D0;
		bsa->bsa_SrcY=3D0;
		bsa->bsa_SrcWidth=3D	bmpWidth;
		bsa->bsa_SrcHeight=3D	bmpHeight;
		bsa->bsa_XSrcFactor=3D	ScalerDiv(bmpWidth,width,bmpWidth);
		bsa->bsa_YSrcFactor=3D	ScalerDiv(bmpHeight,height,bmpHeight);
		bsa->bsa_DestX=3D0;
		bsa->bsa_DestY=3D0;
		bsa->bsa_DestWidth=3D0;
		bsa->bsa_DestHeight=3D0;
		bsa->bsa_XDestFactor=3DScalerDiv(width,width,bmpWidth);
		bsa->bsa_YDestFactor=3DScalerDiv(height,height,bmpHeight);
		bsa->bsa_SrcBitMap=3Ddata->img->bitmap;
		bsa->bsa_DestBitMap=3DtmpBMP;

		sprintf(pippo,"4:%d\n",width);
		Write(data->debug,pippo,strlen(pippo));

		BitMapScale(bsa);

		sprintf(pippo,"5:%d\n",width);
		Write(data->debug,pippo,strlen(pippo));

		BltBitMapRastPort(tmpBMP,
								0,
								0,
								_rp(obj),
								_mleft(obj),
								_mtop(obj),
								bsa->bsa_DestWidth,
								bsa->bsa_DestHeight,
								0x0c0);

		sprintf(pippo,"%d %d %d %d\n",	bsa->bsa_DestWidth,
													bsa->bsa_DestHeight,
													width,height);
		Write(data->debug,pippo,strlen(pippo));

		FreeVec(bsa);
		FreeBitMap(tmpBMP);
		return(0);
	}

	width=3DbmpWidth;
	if (width>(_mright(obj)-_mleft(obj))) width=3D_mright(obj)-_mleft(obj);
	height=3DbmpHeight;
	if (height>(_mbottom(obj)-_mtop(obj))) height=3D_mbottom(obj)-_mtop(obj);
	BltBitMapRastPort(	data->img->bitmap,
								0,
								0,
								_rp(obj),
								_mleft(obj),
								_mtop(obj),
								width,
								height,
								0x0c0
							);

   return(0);
}

struct AlienImage *CaricaImmagine(struct MUI_RenderInfo *mri,char *spec)
{
	struct AlienImage *img;
	APTR obj,bitmap;

	img=3DAllocVec(sizeof(struct AlienImage),MEMF_CLEAR);
	if (!img) return(NULL);

   {	obj =3D NewDTObject(spec,
								DTA_GroupID          , GID_PICTURE,
                        PDTA_FreeSourceBitMap, TRUE,
                        OBP_Precision        , PRECISION_EXACT,
                        PDTA_DestMode        , MODE_V43,
                        PDTA_UseFriendBitMap , TRUE,
                        PDTA_Screen          , mri->mri_Screen,
                        TAG_DONE);

      if (obj)
      {	struct FrameInfo fri =3D {NULL};
         DoMethod(obj,DTM_FRAMEBOX,NULL,&fri,&fri,sizeof(struct FrameInfo),=
0);
         if (fri.fri_Dimensions.Depth>0)
			{	if (DoMethod(obj,DTM_PROCLAYOUT,NULL,1))
            {	struct BitMapHeader *bmhd;
               get(obj,PDTA_BitMapHeader,&bmhd);
               GetDTAttrs(obj,PDTA_DestBitMap,&bitmap,TAG_DONE);
               if (!bitmap) GetDTAttrs(obj,PDTA_BitMap,&bitmap,TAG_DONE);
					img->bitmap=3Dbitmap;
					img->obj=3Dobj;
               return(img);
            }
         }
         DisposeDTObject(obj);
      }
	}
   return(NULL);
}

void RilasciaImmagine(struct AlienImage *img)
{
	DisposeDTObject(img->obj);
}

Serialmente BY(T)E!  Paolo.Menichetti@infoservice.it  2:332/118.13@fidonet
Paolo Menichetti     menichetti@nikita.nervous.com    39:102/201.13@amigane=
t

Subject: Betatesters for Picture.mcc wanted!
Date: 13 Jun 1996 16:51:08
Organization: primalinea & ESS software
X-Newsreader: MM v1.2x/p #1041/NetGate 1.2a
MIME-Version: 1.0
Content-Transfer-Encoding: QUOTED-PRINTABLE
Resent-Message-ID: <"uyuir.0.5b3.PR9mn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1544
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 20
Status: RO
Content-Type: TEXT/PLAIN; charset="ISO-8859-1"
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Length: 539


I'm looking for some betatesters of my picture.mcc class.  It allow load a
picture with datatype, scale it, and support CyberGFX.

I need someone that could test it on:
- ECS machines;
- AGA machines (with/out CyberGFX);
- CyberGFX machines.

A test application are included.

Picture.mcc require AmigaOS 3.x.

Please, e-mail me the request with a short descripion of your system.

Serialmente BY(T)E!  Paolo.Menichetti@infoservice.it  2:332/118.13@fidonet
Paolo Menichetti     menichetti@nikita.nervous.com    39:102/201.13@amigane=
t



From: Ellis Pritchard 
Date: Wed, 19 Jun 96 14:09:53 +0100
To: mui@sunsite.Informatik.RWTH-Aachen.de
Subject: Re: Quick question
References: <199606191135.TAA21758@decadence>
X-Homemail: mailto:efp90@nuke.dircon.co.uk
X-Url: http://www.users.dircon.co.uk/~nuke/
Resent-Message-ID: <"4Mhkt1.0.NE6.Gs_nn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1570
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 64
Status: RO
Content-Type: text/plain
Content-Length: 1583

Hi Jason,

> Has anyone ever needed to return other than TRUE after processing
> one of their tags in an OM_GET switch statement, or needed to do
> anything other than a break after processing one of their tags in
> an OM_SET switch statement? That is,
> OM_GET:
> switch (tag) {
> case SOME_TAG:
> process, process, process, process...
>
> ----->      return (TRUE);
> }
>

I believe the convention is return TRUE if tag exists, FALSE (done by
rootclass) if not, so there is no problem here, you should look at
the value of the attr for failure (actually, anything gettable that
may fail I use a separate method for, which is much neater).

> OM_SET:
> for (tags = ((struct opSet *) msg)->ops_AttrList; tag =
> NextTagItem(&tags);) { switch (tag->ti_Tag) {
> case SOME_TAG:
> process, process, process, process...
>

I've certainly had to do more; basically in optimizing a
refresh where several tags are set; suppose you have a class
with coordinate tags; so the common usage would be:

  SetAttrs(obj, MUIA_MyClass_Left, x, MUIA_MyClass_Top, y, TAG_END);

Then in MyClass_SetAttrs() you wouldn't want to do:

    case MUIA_MyClass_Left:
	data->left = tag->ti_Data;
        MUI_Redraw(obj, xxxxx);
        break;

    case MUIA_MyClass_Top:
	data->top = tag->ti_Data;
        MUI_Redraw(obj, xxxx);
        break;

but

    case MUIA_MyClass_Left:
        data->left = tag->ti_Data;
        refresh = TRUE;
        break;

    case MUIA_MyClass_Top:
        data->top = tag->ti_Data;
        refresh = TRUE;
        break;

     };

     if(refresh) MUI_Draw(obj, xxxx);


Ellis.

From: Gilles MASSON 
To: mui@Susi.Informatik.RWTH-Aachen.de
Subject: Re: Quick question 
In-reply-to: Your message of "Wed, 19 Jun 96 19:35:06 +0800."
             <199606191135.TAA21758@decadence> 
Mime-Version: 1.0
Date: Wed, 19 Jun 96 14:45:18 +0200
Sender: masson@iut-soph.unice.fr
X-Mts: smtp
Resent-Message-ID: <"j0N6f2.0.516.uS_nn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1569
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 64
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 1346

> OM_GET:
> switch (tag) {
>     case SOME_TAG:
>             process, process, process, process...
> 
> ----->      return (TRUE);
> }

the return (TRUE); is needed to tell that your get method know the
tag and have set its return value, because if you don't know it,
the DoSuperMethodA(cl,obj,msg) which should be after will call
the parent class get method which perhaps knows it.

You can make that too, if you like more:

...mGet()
{
  ...
  switch(...)
  {
    case SOME_TAG:
      process, process, process, process...
      break;
    case SOME_OTHER_TAG:
      process, process, process, process...
      break;
    default:
      return(DoSuperMethodA(cl,obj,msg));
  }
  return (TRUE);
}
but then ALL reconized tags will return TRUE, no choice...
and you must add break instead of return(TRUE), so...


> OM_SET:
> for (tags = ((struct opSet *) msg)->ops_AttrList; tag = NextTagItem(&tags);) {
>   switch (tag->ti_Tag) {
>     case SOME_TAG:
>             process, process, process, process...
> 
> ----->      break;
>     }
> }

Do you know the C language ?  there is no workaround for a break or a return
to make exclusive cases in a switch statement.
You can do a
if      (tag->ti_Tag == SOME_TAG)
{
}
else if (tag->ti_Tag == SOME_OTHER_TAG)
{
}
.....
else
{
}
if you like more, but it's sure not better.

regards,
Gilles MASSON

From: flavio@iestn.inet.it (Flavio Stanchina)
To: mui@Susi.Informatik.RWTH-Aachen.de
Reply-To: mui@Susi.Informatik.RWTH-Aachen.de
Subject: Re: Method return value ?
Date: 18 Jun 1996 20:56:08
References: <199606181154.NAA03032@ogpsrv.unice.fr>
Organization: I&S Informatica e Servizi
X-Newsreader: MM v1.2x *UNREG*/NetGate 1.2a
MIME-Version: 1.0
Content-Transfer-Encoding: QUOTED-PRINTABLE
Resent-Message-ID: <"WhP6Y2.0.HC1.wk4on"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1577
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 42
Status: RO
Content-Type: TEXT/PLAIN; charset="ISO-8859-1"
Content-Length: 1197

Hello Gilles,
in a message dated 18 Jun 96 you wrote:

 GM> How to make a method give a return value for
 GM> the DoMethod() which called it ?

The return value of DoMethod() is the return value of your class' dispatche=
r.
For example, in your application you have:

  LONG theAnswer =3D (LONG)DoMethod(obj, MUIM_GetTheAnswer);

..and in your dispatcher:

  ULONG MyDispatcher(...)
  {
    switch (msg->MethodID)
    {
    case MUIM_GetTheAnswer:
      return (ULONG)42;
    }

    return DoSuperMethod(cl, obj, msg);
  }

For another example, usually OM_SET and OM_GET (invoked by SetAttrs() and
GetAttr() respectively) return TRUE or FALSE depending if they were able to
set/get the given attribute or not. That's the way you know if a class has
a certain attribute: you GetAttr() it and check the return code. (Or at
least *my* classes pay great care in returning consistent values.)

 GM> (i don't have the RKRM but only the RKMs1.3 :(  )

Well, you should really get at least the BOOPSI part of the RKM Libraries.

Ciao,
        Flavio

// Home: Amiga Programmer   // Work: AutoCAD Developer
//       Trento, Italy      //       I&S Informatica e Servizi srl
//       Amiga 3000/8Mb/1Gb //


From: alx@post.Uni-Bielefeld.DE (ALeX Kazik)
Reply-To: akazik@TechFak.Uni-Bielefeld.DE
To: mui@sunsite.Informatik.RWTH-Aachen.de (MUI - Mailinglist)
Date: Wed, 19 Jun 1996 22:43:21
Message-Id: 
X-Mailer: YAM 1.2 by Marcel Beck
Subject: A problem and three classes.
Resent-Message-ID: <"RZGBO1.0.0r1.dS6on"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1581
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
Content-Type: text
Content-Length: 3717
X-Lines: 87
Status: RO


  Hi there.

Actually I am writing a programm with MUI and for this programm I created
three mui custom classes. Now is my question, should I register theese classes
(or some of them) or not? And there a problem with on class.


### THE CLASSES

The tree classes, I've bilud:
1) ChooseFields.mcc
   Have you ever seen the Drag'n'Drop demo from MUI?
   OK, this class makes do something like that - two listviews and
   drag'n'drop from one to the another very easy.
   You have only to specify an SourceArray, in the simpiest case an array
   of STRPTRs. Than you have to say, which of theese fields should be
   available. Now you can get/set the selected entries, by their 
   SoureArray number. If the user changes the entries, I say it you.
   If the source isn't a string, you have to specify display hooks for
   both listviews and a conpare function for the available listview,
   the user have to sort the selected.
   And as an extra you can specify the minimum and maximum of selected
   entries.
   Its possible to get the pointers of the listviews, if you want to
   do something with there, e.g. recact of doubleclicks...

2) Time.mcc
   This class is a especial string-gadget, it allows to enter an integer
   like time (H:MIN) or normal (MIN). The display is like the programmer
   wants (H:MIN or MIN). And at least you can specify a minimin and maximum
   value. The get/set and the min/max-Vals are all in minutes.
   
3) Listview2.mcc
	This is an special listview, its possible to scroll horizontal.
	But, you must specify the (min)width, there are tree ways:
	a) in pixel
	b) in chars
	c) you can set MUIA_List_AdjustWidth to the List inside, and you
	   have to fill it before displaying... you can (with scroll) see
	   all colums.

     /----+-------------------------------------------------------------+
    /     |   Alexander Kazik * Stapenhorststr.  81 * 33615 Bielefeld   |
   / ALeX |           ** Amiga 1000 & Amiga 4000/030/50 **              |
   |      |  ++49-521-130325     *     akazik@TechFak.Uni-Bielefeld.DE  |

From: jasonb@cs.uwa.edu.au
Message-Id: <199606241023.SAA25960@decadence>
Subject: Re: A problem and three classes.
To: mui@Susi.Informatik.RWTH-Aachen.de
Date: Mon, 24 Jun 1996 18:23:49 +0800 (WST)
In-Reply-To: <199606231026.MAA173352@venere.inet.it> from "Flavio Stanchina" at Jun 22, 96 01:43:38 pm
X-Mailer: ELM [version 2.4 PL25]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Resent-Message-ID: <"nf8yZ1.0.oN3.0rcpn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1619
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 40
Status: RO
Content-Type: text/plain; charset="US-ASCII"
Content-Length: 1774

> Yes, I read that part of the docs too, but my registration number is some
> 10 digits long, so it doesn't fit into 15 bits.

Wow - MUI now has more registered users than there are people in the
world. ;-) I guess Stefan isn't using a simple incremental numbering
scheme.
 
> I asked Stefan and he told me that I have to ask Klaus Melchior for unique
> class ID's, but I wonder if I have to do that for private classes too.

For private classes, the only thing you *need* to make sure of is that
none of the parent classes of your private class has the same numerical
ID value, otherwise you might be sending your class a method
MUIM_MyClass_Blah and one of the ancestors sees it as a 
MUIM_OtherClass_Bob. If you know you have a private class that can never
be an ancestor of another private class, they can share values, but
the other problem is that you might accidentally send a value of one
class to an object of another class and rather than simply ignoring
it, it will try to interpret it.
 
> I'm also wondering if I can reuse, say, ASL tags for my classes, instead of
> defining my own. I'm writing a class with features similar to an ASL screen
> mode requester, and I'm just using ASL tags so I don't need to change the
> test program too much (I just plugged my class in a program that used ASL).
> It seems to work, but I'd like an official statement of correctness.

I'd say it's ok, but that's not an official statement. :-)
 
> Ciao,
>         Flavio

Cheers,
Jason.

-- 
Jason S Birch                        ,-_|\ email: jasonb@cs.uwa.edu.au


From: Gilles MASSON 
To: mui@Susi.Informatik.RWTH-Aachen.de
Subject: Re: Bitmaps & MUIM_List_CreateImage / DoMethod() return value 
In-reply-to: Your message of "Mon, 24 Jun 96 19:23:38 BST."
             <81322827@magic.informatik.tu-muenchen.de> 
Mime-Version: 1.0
Date: Tue, 25 Jun 96 09:44:11 +0200
Sender: masson@iut-soph.unice.fr
X-Mts: smtp
Resent-Message-ID: <"CyZYQ1.0.Vt1.gbvpn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1632
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 29
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 1130

> Michael Neuweiler wrote in article <1977.6730T1166T2698@zool.unizh.ch>:
> 
> > Is MUIM_List_CreateImage only applicable in MUIM_Setup, Stefan ??
> 
> You can call MUIM_List_CreateImage as soon as the list class completed
> its setup method. You must call MUIM_List_DeleteImage before the list
> completes its cleanup method.
> 
> > I must admit, that sounds logical ! Thanks.. :)
> > But if I do it on the list after MUIM_Setup 80000004 greets me.. :/

  After many problems with return value from a DoMethod(), i have
found that it don't work when the method is one of a child of
the specified object and not the object itself.
  I mean that i have a custom group subclass, with as child a custom
area subclass, if i do a DoMethod() on the first object with a method
of the second one, the method is done but the return value is false.
If i do the DoMethod() directly on the child object, the method is
done too and the return value is good...  Isn't it strange Stefen ?

  In your case, perhaps that you do the DoMethod() on the Listview
object and that it must be done directly on the List one...

regards,


Gilles MASSON

From: "Stefan Stuntz" 
Date: Fri, 28 Jun 1996 16:20:24 +0100
X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96)
Subject: Re: [ML_MUI-BETA] Re: Page Down / Page Up
Message-Id: <81322938@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-ID: <"U-diK.0.tJ1.4j-qn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1675
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
Content-Type: text
Content-Length: 388
X-Lines: 15
Status: RO


Pino Aliberti wrote

> visible or, even better, give the programmer the ability to do something like
> DoMethod(obj, MUIM_KeyEvent, MUIKEY_PAGEDOWN).

You can fake MUIKEY events with something like
DoMethod(object,MUIM_HandleInput,NULL,MUIKEY_PAGEDOWN);

BTW, I hope you custom class writers are all aware to receive
HandleInput messages with a NULL IntuiMessage!

--
Greetings, Stefan

From: "Stefan Stuntz" 
Date: Fri, 28 Jun 1996 16:20:24 +0100
X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96)
Subject: Re: how to implement a (start) Drag ?
Message-Id: <81322937@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-ID: <"uSRcm.0.5K1.Cj-qn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1676
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
Content-Type: text
Content-Length: 460
X-Lines: 15
Status: RO


Gilles MASSON wrote in article <199606280811.KAA01802@ogpsrv.unice.fr>:

> How can i implement Drag & Drop on a custom Area sub-class ?
>
> I mean that i want to make some part of my class/object draggable
> (and i don't say droppable, which is not hard to do...).

You can only drag complete MUI objects, not parts of them. If you feel
you must drag parts, it might be time to reconsider your class tree and
split it up a little more.

--
Greetings, Stefan


From: flavio@iestn.inet.it (Flavio Stanchina)
To: mui@Susi.Informatik.RWTH-Aachen.de
Reply-To: mui@Susi.Informatik.RWTH-Aachen.de
Subject: Re: OM_DISPOSE - suicide
Date: 30 Jun 1996 22:45:03
References: 
Organization: I&S Informatica e Servizi
X-Newsreader: MM v1.2x *UNREG*/NetGate 1.2a
MIME-Version: 1.0
Content-Transfer-Encoding: QUOTED-PRINTABLE
Resent-Message-ID: <"16tRY1.0.mh5.SKmrn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1696
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 29
Status: RO
Content-Type: TEXT/PLAIN; charset="ISO-8859-1"
Content-Length: 951

Johnny Tevessen wrote:

 JT> [...] I'm having a derived window class, and I want the
 JT> window to close, remove itself from the application's list and
 JT> dispose itself including its children.

 JT> Is it okay to e/g set up a notification like this:

 JT>     DoMethod(obj,
 JT>          MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
 JT>          MUIV_Notify_Self, 1, OM_DISPOSE
 JT>     );

According to "intuition/classusr.h", you are not allowed to invoke
OM_DISPOSE directly. You should really use {MUI_}DisposeObject().

I think that the most polite solution for your problem would be to set up
an hook that detaches the window from the application and then calls
MUI_DisposeObject() on the window object.

Ciao,
        Flavio


From: flavio@iestn.inet.it (Flavio Stanchina)
To: mui@Susi.Informatik.RWTH-Aachen.de
Reply-To: mui@Susi.Informatik.RWTH-Aachen.de
Subject: Re: MCCReg Info
Date: 30 Jun 1996 23:14:53
References: <28780@eifel.oche.de>
Organization: I&S Informatica e Servizi
X-Newsreader: MM v1.2x *UNREG*/NetGate 1.2a
MIME-Version: 1.0
Content-Transfer-Encoding: QUOTED-PRINTABLE
Resent-Message-ID: <"NCZDf.0.wh5.TKmrn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1697
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 108
Status: RO
Content-Type: TEXT/PLAIN; charset="ISO-8859-1"
Content-Length: 3772

MCCReg wrote:

 M> You should *only* make MCCs when you intend to release a custom class=
 to
 M> the public and document its interface. You should *not* make MCCs for
 M> classes which are only used by yourself. If you need a class in
 M> different executables, you may put this class into an external library
 M> to reuse the code.

But then you are required to use a different syntax for creating you
objects, and I don't like that. Well, it's not the end of the world, but...

Wouldn't it be nice to be able to create "private classes" in exactly the
same way as we do MCC's?

 M>  1) At first send *only* information to about what kind of class you
 M>     are writing. A short description is fine.

Ok, so here are the classes I'm working on. (Klaus, you'll get a more
detailed list by email.)

ColorButton
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
GadTools-like palette gadget that allows you to choose a color from a given
set, usually the screen palette.

FileGroup
=3D=3D=3D=3D=3D=3D=3D=3D=3D
A complete file requester as a MUI class.

FileList
=3D=3D=3D=3D=3D=3D=3D=3D
MUI's Dirlist didn't suit all my needs, so here it is: FileList is
basically a clone of Dirlist, but with some more methods and attributes
(and some missing attributes too, but they were not that useful).

FontDisplay
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Display a given font's appearance. You can set font name, size and style,
and you can change foreground and background pens. A simple Text object
wasn't enough because MUIA_Font is I.G.

FontGroup
=3D=3D=3D=3D=3D=3D=3D=3D=3D
A complete font requester as a MUI class.

FontList
=3D=3D=3D=3D=3D=3D=3D=3D
A list of available fonts. This list can be connected to a numeric list
(see NumericList) for displaying available font sizes.

Traditional MUI applications don't have to bother about fonts, but then
someone might need to render things in another font. What about a MUI word
processor, for example?

ModeGroup
=3D=3D=3D=3D=3D=3D=3D=3D=3D
A complete screen mode requester as a MUI class.

ModeList
=3D=3D=3D=3D=3D=3D=3D=3D
A list of available display modes.

NumericList
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
A list of LONG values.

NumericString
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This is a subclass of Group class which features a numeric string and
two arrow buttons for incrementing/decrementing the numeric value, as
other platforms' numeric strings have.

This class understand almost all String attributes, plus some Numeric
class attributes and methods that let NumericString behave like a real
numeric string gadget should.

There are at least three numeric input classes available in MUI, but some
applications could need a traditional string gadget because the acceptable
range of input values doesn't fit well in the limits of a slider or a knob.

*** end-of-list ***

Names and features are subject to change, but you get the idea. For now,
I'd like to receive feedback on which classes could be useful for others.

As someone might have guessed, I'm working on a MUIfied ASL clone; in fact,
most of the work is done by now. I'm planning to release a beta version
soon, I just need to ask for my tag IDs (which I'll do in a few minutes)
and to solve a couple of problems I encountered with IconEdit. I'd like
even more to receive feedback on *this* project.

 M> * Config IDs
 M> Also the IDs to store configuration data of you MCP [...]

How do I write a .mcp file? I guessed something from the MCC skeleton
posted recently by Stefan, but I don't think there is specific
documentation available.

Ciao,
        Flavio

// Home: Amiga Programmer   // Work: AutoCAD Developer
//       Trento, Italy      //       I&S Informatica e Servizi srl
// Bike: Husqvarna WR 360
// Computer: Amiga 3000/8Mb/1Gb
// Snowboard: Burton T.Decks 53


From: "Stefan Stuntz" 
Date: Mon, 01 Jul 1996 11:12:46 +0100
X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96)
Subject: Re: MCCReg Info
Message-Id: <81323180@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-ID: <"KqxsK2.0.3b.ZSvrn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1705
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
Content-Type: text
Content-Length: 1395
X-Lines: 36
Status: RO


Flavio Stanchina wrote in article <199606302250.AAA168468@venere.inet.it>:

>  M> You should *only* make MCCs when you intend to release a custom class to
>  M> the public and document its interface. You should *not* make MCCs for
>  M> classes which are only used by yourself. If you need a class in
>  M> different executables, you may put this class into an external library
>  M> to reuse the code.
>
> But then you are required to use a different syntax for creating you
> objects, and I don't like that. Well, it's not the end of the world, but...
>
> Wouldn't it be nice to be able to create "private classes" in exactly the
> same way as we do MCC's?

I guess with the right kind of skeleton and a little work, one could
handle public and private classes almost identically. Problem is that
public custom classes are referenced by name, so they need to be
registered to avoid conflicts.

Hmm... maybe we could invent a scheme where certain names are completely
reserved for application-private classes. You could then have a mui
directory in the directory tree of your application and put your private
classes there:

mui/Toolbar1441.mcc
mui/MyString1441.mcc
...

where 1441 is your unique serial number. This would allow you to have
private classes as mcc files and avoids name collisions. You can use
these classes simply with NewObject("Toolbar1441.mcc",...);

--
Greetings, Stefan


From: "Stefan Stuntz" 
Date: Mon, 01 Jul 1996 11:12:46 +0100
X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96)
Subject: Re: OM_DISPOSE - suicide
Message-Id: <81323181@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-ID: <"E6zQ.0.Lb.hSvrn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1706
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
Content-Type: text
Content-Length: 1185
X-Lines: 31
Status: RO


Flavio Stanchina wrote in article <199606302250.AAA180898@venere.inet.it>:

>  JT> [...] I'm having a derived window class, and I want the
>  JT> window to close, remove itself from the application's list and
>  JT> dispose itself including its children.
>
>  JT> Is it okay to e/g set up a notification like this:
>
>  JT>     DoMethod(obj,
>  JT>          MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
>  JT>          MUIV_Notify_Self, 1, OM_DISPOSE
>  JT>     );
>
> According to "intuition/classusr.h", you are not allowed to invoke
> OM_DISPOSE directly. You should really use {MUI_}DisposeObject().
>
> I think that the most polite solution for your problem would be to set up
> an hook that detaches the window from the application and then calls
> MUI_DisposeObject() on the window object.

This doesnt need to be a hook. OO-style would be to have a subclass of
window class with a method like MUIM_MyWindow_Kill. This method would
then remove the window object from the application and call
MUI_DisposeObject() on itself. Of course, you must make sure that you
return directly after disposing yourself instead of calling
DoSuperMethod() or other stuff.

--
Greetings, Stefan


From: jasonb@cs.uwa.edu.au
Message-Id: <199607020322.LAA06404@decadence>
Subject: Re: Wait bits
To: mui@Susi.Informatik.RWTH-Aachen.de
Date: Tue, 2 Jul 1996 11:22:37 +0800 (WST)
In-Reply-To: <19960701.7644F30.13C2F@amp.flashnet.it> from "Emanuele Viola" at Jul 1, 96 10:17:14 pm
X-Mailer: ELM [version 2.4 PL25]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Resent-Message-ID: <"FT-iE1.0.-t6.DP9sn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1726
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 41
Status: RO
Content-Type: text/plain; charset="US-ASCII"
Content-Length: 1476

> I mean something like this:
> 
>      struct MUI_InputHandlerNode MyIHNode;
>      ...
> 
>      MyIHNode.ihn_Object  = MyWindow;
>      MyIHNode.ihn_Signals = (1 << MyPort[0]->mp_SigBit);
>      MyIHNode.ihn_Method  = WOT HERE??;
>                          ^^^^^^^^^

This has to be a method ID, you can't put a function pointer here. The
method will be sent to .ihn_Object whenever the event occurs (and,
additionally, whenever MUI is getting a bit bored, so you have to check
if the event really arrived). So yes, you do have to write a custom
class. This is really very painless, however -- it's ok and good OO
style to write a custom class that only has one extra method (and very
easy with MUI2C as well ;) rather than try to call a hook with an
existing class.

>      MyIHNode.ihn_Flags   = 0;
>      ...
>      DoMethod(MyWindow,MUIM_Application_AddInputHandler,&IHNode);
> 
>   DoMethod(MyWindow,MUIM_Notify,MUIA_WOT
> HERE??,MUIV_EveryTime,app,2,MUIM_CallHook,&The Hook I Want);
>                                 ^^^^^^^^^^^^^^^^

MUIA_WOT HERE would have to be an attribute that gets set in the
method WOT HERE for this to work.

> Thanx a lot

No worries. Cheers,
Jason.


From: "Stefan Stuntz" 
Date: Wed, 03 Jul 1996 11:38:25 +0100
X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96)
Subject: Re: MCCReg Info
Message-Id: <81323218@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-ID: <"vMCeb1.0.7F7.g_Zsn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1750
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
Content-Type: text
Content-Length: 921
X-Lines: 27
Status: RO


Flavio Stanchina wrote in article <199607021656.SAA177054@venere.inet.it>:

> Well, if the problem is only the uniqueness of the name, we only have to
> prepend our MCC tag base number (padded with 0's to avoid any potential
> conflicts) to the class name.

Uniqueness is indeed the only problem. I suggest a format like this:

1441_Toolbar.mcc

ie 4-digit serial number, followed by an underscore, followed by a
somewhat meaningfull name. This fixed format allows me to handle these
classes in a preferences editor some day.

Private custom classes need to be placed in a mui/ subdir of your
applications main directory. MUI will find it there if you simply do a
MUI_NewObject("1441_Toolbar.mcc"). Do not install them in mui:libs!

> Er... You didn't make any comment on my "MUIfied ASL" project... I would
> really like to hear your opinion.

How shall I comment something I havent seen yet? :)

--
Greetings, Stefan


From: Gilles MASSON 
To: mui@Susi.Informatik.RWTH-Aachen.de
cc: masson@ogpsrv.unice.fr
Subject: Re: OM_DISPOSE - suicide 
In-reply-to: Your message of "Thu, 04 Jul 96 11:57:05 +0200."
             <96Jul4.115714met_dst.192014@sunbulirsch11.mathematik.tu-muenchen.de> 
Mime-Version: 1.0
Date: Thu, 04 Jul 96 13:50:10 +0200
Sender: masson@iut-soph.unice.fr
X-Mts: smtp
Resent-Message-ID: <"bZw6p2.0.485.64xsn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1774
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 49
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 1972

> > ] This doesnt need to be a hook. OO-style would be to have a subclass of
> > ] window class with a method like MUIM_MyWindow_Kill. This method would
> > ] then remove the window object from the application and call
> > ] MUI_DisposeObject() on itself. Of course, you must make sure that you
> > ] return directly after disposing yourself instead of calling
> > ] DoSuperMethod() or other stuff.
> > 
> > And it's legal because if the data of the object are gone, the code of
> > the class should still be here.
> 
> Now hear that. The code _should_ still be there. And who guarantees that?
> What, if immediately after the MUI_DisposeObject-Call an expunge on the
> class is invoked? One can never be sure about such things. Then there would
> be no code to run in, even if there is a return right afterwards.

Yes, you're right, but the subclass that implement this method should not
be and external .mui, .mcc or .mcp of course. Thats subclass is IN the
program, or eventually in a .library that is open at start of the program
and closed at end, so there is no expunge while using it.

> I still am very uneasy with objects disposing themself. If the disposal
> would be done in a hook, that's code does not belong to the object itself,
> maybe.
> 
> BTW, your proposed method would definitely not work anymore if the disposal
> of the window would be triggered by notification of a button that is inside
> the window. This way you sureley get a software failure (well, at least
> tons of enforcer hits).

Yes you should use the PushMethod anyway to avoid that the return() try
to return to a code&data of the window or one of its childs :

  DoMethod(app,MUIM_Application_PushMethod,
           win_obj,2,MUIM_MyWindow_Kill,TRUE);

or with a notify :

  DoMethod(win_obj,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,
           app,5,MUIM_Application_PushMethod,
           win_obj,2,MUIM_MyWindow_Kill,TRUE);

Should be ok, i think, no ?

Regards,


Gilles MASSON

From: Gilles MASSON 
To: mui@Susi.Informatik.RWTH-Aachen.de
cc: masson@ogpsrv.unice.fr
Subject: Betatesters for Picture.mcc wanted
Mime-Version: 1.0
Date: Thu, 11 Jul 96 10:04:20 +0200
Sender: masson@iut-soph.unice.fr
X-Mts: smtp
Resent-Message-ID: <"vOdbO1.0.9P3.JPBvn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1804
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
X-Lines: 14
Status: RO
Content-Type: text/plain; charset="us-ascii"
Content-Length: 261

	Hi all,

I'm looking for some betatesters of my NList.mcc/NListview.mcc classes.

It's a List/Listview clone which handle horizontal scrolling.

Please, e-mail me if you're interested.

Regards,

Gilles MASSON
masson@alto.unice.fr / masson@iut-soph.unice.fr


From: "Stefan Stuntz" 
Date: Mon, 22 Jul 1996 17:04:56 +0100
X-Mailer: IntuiNews 1.4 (28.6.96)
Subject: Re: Setting Object sizes...
Message-Id: <81323564@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-ID: <"6n5EC.0.pW3.Kavyn"@susi>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de
X-Mailing-List:  archive/latest/1977
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de
Content-Type: text
Content-Length: 831
X-Lines: 20
Status: RO


Hans-Joerg Frieden wrote in article <199607212028.WAA02737@fix.uni-trier.de>:

> I've got a minor problem with MUI. I want to make an object and change
> its size _after_ it was created, i.e. I want it to become larger or
> smaller and have the whole window adjust the size to fit the new
> dimensions. I've read that MUIA_Width/Height are only gettable... I know
> that this is not good style, but believe me, for the application I am
> writing, this _does_ make sense...
>
> Perhaps I should mention that this will probably be a subclass of
> areaclass and be the only child of its parent window...

You can only do this if you have a custom class and have control over
the min/max dimensions. Then, you can send MUIM_InitChange/ExitChange
to your parent group to make the window adapt to the new values.

--
Greetings, Stefan